Skip to content

Commit 169d1c1

Browse files
refactor 319
1 parent fd0585a commit 169d1c1

File tree

1 file changed

+0
-20
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+0
-20
lines changed

src/main/java/com/fishercoder/solutions/_319.java

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,5 @@
11
package com.fishercoder.solutions;
22

3-
/**
4-
* 319. Bulb Switcher
5-
*
6-
* There are n bulbs that are initially off. You first turn on all the bulbs.
7-
* Then, you turn off every second bulb. On the third round,
8-
* you toggle every third bulb (turning on if it's off or turning off if it's on).
9-
* For the ith round, you toggle every i bulb. For the nth round, you only
10-
* toggle the last bulb. Find how many bulbs are on after n rounds.
11-
12-
Example:
13-
14-
Given n = 3.
15-
16-
At first, the three bulbs are [off, off, off].
17-
After first round, the three bulbs are [on, on, on].
18-
After second round, the three bulbs are [on, off, on].
19-
After third round, the three bulbs are [on, off, off].
20-
21-
So you should return 1, because there is only one bulb is on.
22-
*/
233
public class _319 {
244

255
public static class Solution1 {

0 commit comments

Comments
 (0)