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

Commitbe32346

Browse files
[LEET-3274] add 3274
1 parentd464578 commitbe32346

File tree

2 files changed

+26
-0
lines changed
  • paginated_contents/algorithms/4th_thousand
  • src/main/java/com/fishercoder/solutions/fourththousand

2 files changed

+26
-0
lines changed

‎paginated_contents/algorithms/4th_thousand/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
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|
1010
| 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|
11+
| 3274|[Check if Two Chessboard Squares Have the Same Color](https://leetcode.com/problems/check-if-two-chessboard-squares-have-the-same-color/)|[Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3274.java)|| Easy|
1112
| 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|
1213
| 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|
1314
| 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: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
packagecom.fishercoder.solutions.fourththousand;
2+
3+
importjava.util.HashSet;
4+
importjava.util.Set;
5+
6+
publicclass_3274 {
7+
publicstaticclassSolution1 {
8+
publicbooleancheckTwoChessboards(Stringcoordinate1,Stringcoordinate2) {
9+
returnisBlack(coordinate2) ==isBlack(coordinate1);
10+
}
11+
12+
privatebooleanisBlack(Stringcoordinate) {
13+
Set<Character>blackColsWithOddRows =newHashSet<>();
14+
blackColsWithOddRows.add('a');
15+
blackColsWithOddRows.add('c');
16+
blackColsWithOddRows.add('e');
17+
blackColsWithOddRows.add('g');
18+
if (blackColsWithOddRows.contains(coordinate.charAt(0))) {
19+
returnCharacter.getNumericValue(coordinate.charAt(1)) %2 ==1;
20+
}else {
21+
returnCharacter.getNumericValue(coordinate.charAt(1)) %2 ==0;
22+
}
23+
}
24+
}
25+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp