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

Commitd3b69ba

Browse files
add 991
1 parent8349cd9 commitd3b69ba

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

‎README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,7 @@ _If you like this project, please leave me a star._ ★
338338
|1003|[Check If Word Is Valid After Substitutions](https://leetcode.com/problems/check-if-word-is-valid-after-substitutions/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1003.java)||Medium|
339339
|1002|[Find Common Characters](https://leetcode.com/problems/find-common-characters/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1002.java)||Easy|
340340
|999|[Available Captures for Rook](https://leetcode.com/problems/available-captures-for-rook/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_999.java)||Easy|
341+
|991|[Broken Calculator](https://leetcode.com/problems/broken-calculator/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_991.java) | |Medium|Math, Greedy
341342
|981|[Time Based Key-Value Store](https://leetcode.com/problems/time-based-key-value-store/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_981.java)|[:tv:](https://youtu.be/eVi4gDimCoo)|Medium|
342343
|997|[Find the Town Judge](https://leetcode.com/problems/find-the-town-judge/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_997.java)||Easy|
343344
|994|[Rotting Oranges](https://leetcode.com/problems/rotting-oranges/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_994.java) | |Easy| BFS
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
packagecom.fishercoder.solutions;
2+
3+
publicclass_991 {
4+
publicstaticclassSolution1 {
5+
publicintbrokenCalc(intX,intY) {
6+
intops =0;
7+
while (Y >X) {
8+
ops++;
9+
if (Y %2 !=0) {
10+
Y++;
11+
}else {
12+
Y /=2;
13+
}
14+
}
15+
returnops +X -Y;
16+
}
17+
}
18+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp