Skip to content

Commit e74e7ca

Browse files
update 3014
1 parent 4a95f7b commit e74e7ca

File tree

1 file changed

+4
-4
lines changed
  • src/main/java/com/fishercoder/solutions/fourththousand

1 file changed

+4
-4
lines changed

src/main/java/com/fishercoder/solutions/fourththousand/_3014.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22

33
public class _3014 {
44
public static class Solution1 {
5-
int KEY_COUNT = 8;
65

76
public int minimumPushes(String word) {
7+
int keyCount = 8;
88
int times = 1;
99
int pushes = 0;
1010
int len = word.length();
1111
while (len > 0) {
12-
if (len < KEY_COUNT) {
12+
if (len < keyCount) {
1313
pushes += times * len;
1414
return pushes;
1515
} else {
16-
pushes += times * KEY_COUNT;
17-
len -= KEY_COUNT;
16+
pushes += times * keyCount;
17+
len -= keyCount;
1818
times++;
1919
}
2020
}

0 commit comments

Comments
 (0)