yokostan / Leetcode-Solutions

Doing exercise on Leetcode. Carry on!
0 stars 3 forks source link

Leetcode #319. Bulb Switcher #257

Open yokostan opened 5 years ago

yokostan commented 5 years ago

https://leetcode.com/problems/bulb-switcher/discuss/77104/Math-solution..

Math problem, sqrt(n)

class Solution {
    public int bulbSwitch(int n) {
        return (int)Math.sqrt(n);
    }
}