g0301_0400.s0319_bulb_switcher.Solution Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of leetcode-in-java Show documentation
Show all versions of leetcode-in-java Show documentation
Java-based LeetCode algorithm problem solutions, regularly updated
package g0301_0400.s0319_bulb_switcher;
// #Medium #Math #Brainteaser
public class Solution {
public int bulbSwitch(int n) {
if (n < 2) {
return n;
}
return (int) Math.sqrt(n);
}
}