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

Commitd464578

Browse files
[LEET-3280] add 3280
1 parentd75c98e commitd464578

File tree

3 files changed

+38
-0
lines changed
  • paginated_contents/algorithms/4th_thousand
  • src

3 files changed

+38
-0
lines changed

‎paginated_contents/algorithms/4th_thousand/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
| 3300|[Minimum Element After Replacement With Digit Sum](https://leetcode.com/problems/minimum-element-after-replacement-with-digit-sum/)|[Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3300java)|| Easy|
88
| 3289|[The Two Sneaky Numbers of Digitville](https://leetcode.com/problems/the-two-sneaky-numbers-of-digitville/)|[Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3289.java)|| Easy|
99
| 3285|[Find Indices of Stable Mountains](https://leetcode.com/problems/find-indices-of-stable-mountains/)|[Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3285.java)|| Easy|
10+
| 3280|[Convert Date to Binary](https://leetcode.com/problems/convert-date-to-binary/)|[Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3280.java)|| Easy|
1011
| 3270|[Find the Key of the Numbers](https://leetcode.com/problems/find-the-key-of-the-numbers/)|[Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3270.java)|| Easy|
1112
| 3264|[Final Array State After K Multiplication Operations I](https://leetcode.com/problems/final-array-state-after-k-multiplication-operations-i/)|[Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3264.java)|| Easy|
1213
| 3263|[Convert Doubly Linked List to Array I](https://leetcode.com/problems/convert-doubly-linked-list-to-array-i/)|[Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3263.java)|| Easy|
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
packagecom.fishercoder.solutions.fourththousand;
2+
3+
publicclass_3280 {
4+
publicstaticclassSolution1 {
5+
publicStringconvertDateToBinary(Stringdate) {
6+
String[]parts =date.split("-");
7+
StringBuildersb =newStringBuilder();
8+
for (Stringpart :parts) {
9+
sb.append(Integer.toBinaryString(Integer.parseInt(part)));
10+
sb.append("-");
11+
}
12+
sb.setLength(sb.length() -1);
13+
returnsb.toString();
14+
}
15+
}
16+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
packagecom.fishercoder.fourththousand;
2+
3+
importstaticorg.junit.jupiter.api.Assertions.assertEquals;
4+
5+
importcom.fishercoder.solutions.fourththousand._3280;
6+
importorg.junit.jupiter.api.BeforeEach;
7+
importorg.junit.jupiter.api.Test;
8+
9+
publicclass_3280Test {
10+
private_3280.Solution1solution1;
11+
12+
@BeforeEach
13+
publicvoidsetup() {
14+
solution1 =new_3280.Solution1();
15+
}
16+
17+
@Test
18+
publicvoidtest1() {
19+
assertEquals("100000100000-10-11101",solution1.convertDateToBinary("2080-02-29"));
20+
}
21+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp