num, the decimal form of a positive integer.
Convert the number to hexadecimal using uppercase A–F. Then replace every digit 0 with the letter O and every digit 1 with the letter I.
If the result now contains only letters from the set A, B, C, D, E, F, I, O, return it. If any digit from 2 to 9 is left, return the string "ERROR".num='2766' → 'ACE'
2766 in hexadecimal is ACE, and every symbol is already a letter.
num='4096' → 'IOOO'
4096 is 1000 in hexadecimal: the one becomes I and the zeros become O, giving IOOO.
num='100' → 'ERROR'
100 is 64 in hexadecimal: 6 and 4 have no letter form, so the answer is ERROR.
num consists of digits only and has no leading zeroslen(num) ≤ 40num='2766'
'ACE'
Run checks the first 3 tests in your browser. Submit checks all 87 tests on the server, hidden ones included.