-
-
Notifications
You must be signed in to change notification settings - Fork 291
Expand file tree
/
Copy path319.java
More file actions
25 lines (25 loc) · 724 Bytes
/
319.java
File metadata and controls
25 lines (25 loc) · 724 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
__________________________________________________________________________________________________
sample 31480 kb submission
class Solution {
public int bulbSwitch(int n) {
int i = 1;
int res = 0;
while(i * i <= n) {
res++;
i++;
}
return res;
}
}
__________________________________________________________________________________________________
sample 31500 kb submission
class Solution {
public int bulbSwitch(int n) {
int count = 0;
for (int i = 1; i * i <= n; i++) {
count++;
}
return count;
}
}
__________________________________________________________________________________________________