Skip to content

Commit b8e8777

Browse files
refactor 1271
1 parent 04000c5 commit b8e8777

File tree

1 file changed

+0
-22
lines changed

1 file changed

+0
-22
lines changed

src/main/java/com/fishercoder/solutions/_1271.java

-22
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,6 @@
44
import java.util.HashSet;
55
import java.util.Set;
66

7-
/**
8-
* 1271. Hexspeak
9-
*
10-
* A decimal number can be converted to its Hexspeak representation by first converting it to an uppercase hexadecimal string,
11-
* then replacing all occurrences of the digit 0 with the letter O, and the digit 1 with the letter I.
12-
* Such a representation is valid if and only if it consists only of the letters in the set {"A", "B", "C", "D", "E", "F", "I", "O"}.
13-
* Given a string num representing a decimal integer N, return the Hexspeak representation of N if it is valid, otherwise return "ERROR".
14-
*
15-
* Example 1:
16-
* Input: num = "257"
17-
* Output: "IOI"
18-
* Explanation: 257 is 101 in hexadecimal.
19-
*
20-
* Example 2:
21-
* Input: num = "3"
22-
* Output: "ERROR"
23-
*
24-
* Constraints:
25-
* 1 <= N <= 10^12
26-
* There are no leading zeros in the given string.
27-
* All answers must be in uppercase letters.
28-
* */
297
public class _1271 {
308
public static class Solution1 {
319
public String toHexspeak(String num) {

0 commit comments

Comments
 (0)