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

Commita6370a6

Browse files
add 2169
1 parent0fa9be7 commita6370a6

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

‎README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ _If you like this project, please leave me a star._ ★
88

99
| # | Title | Solutions | Video | Difficulty | Tag
1010
|-----|----------------|---------------|--------|-------------|-------------
11+
|2169|[Count Operations to Obtain Zero](https://leetcode.com/problems/count-operations-to-obtain-zero/)|[Java](../master/src/main/java/com/fishercoder/solutions/_2169.java)||Easy||
1112
|2166|[Design Bitset](https://leetcode.com/problems/design-bitset/)|[Java](../master/src/main/java/com/fishercoder/solutions/_2166.java)||Medium||
1213
|2165|[Smallest Value of the Rearranged Number](https://leetcode.com/problems/smallest-value-of-the-rearranged-number/)|[Java](../master/src/main/java/com/fishercoder/solutions/_2165.java)||Medium||
1314
|2164|[Sort Even and Odd Indices Independently](https://leetcode.com/problems/sort-even-and-odd-indices-independently/)|[Java](../master/src/main/java/com/fishercoder/solutions/_2164.java)||Easy||
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
packagecom.fishercoder.solutions;
2+
3+
publicclass_2169 {
4+
publicstaticclassSolution1 {
5+
publicintcountOperations(intnum1,intnum2) {
6+
intops =0;
7+
while (true) {
8+
if (num1 ==0 ||num2 ==0) {
9+
returnops;
10+
}
11+
if (num1 >=num2) {
12+
num1 -=num2;
13+
}else {
14+
num2 -=num1;
15+
}
16+
ops++;
17+
18+
}
19+
}
20+
}
21+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp