Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb8e8777

Browse files
refactor 1271
1 parent04000c5 commitb8e8777

File tree

1 file changed

+0
-22
lines changed

1 file changed

+0
-22
lines changed

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

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,6 @@
44
importjava.util.HashSet;
55
importjava.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
publicclass_1271 {
308
publicstaticclassSolution1 {
319
publicStringtoHexspeak(Stringnum) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp