Question: Please solve the below question in R - Write a function that, given a string S encoding a decimal integer , returns a string representing
Please solve the below question in R Write a function that, given a string S encoding a decimal integer returns a string representing the HexSpeak representation of if is a valid HexSpeak word, or else ERROR A decimal number can be converted to HexSpeak by first converting it to hexadecimal in upper case then converting the number to the letter O and the number to the letter I A string is considered a valid HexSpeak word if it consists of only the letters ABCDEFIO. The input string will represent a decimal integer between and inclusive. Examples: If the input string is the decimal number it encodes is which is written as in hexadecimal. Since and represent I and O respectively, we should return IOI If the input string is it is written as in hexadecimal, which does not represent a HexSpeak letter, so we return ERROR
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
