public class Solution {
    public int BulbSwitch(int n) {
        var x = Math.Sqrt(n);
            var y = Convert.ToInt32(Math.Floor(x));
            return y;
    }
}

https://leetcode.com/problems/bulb-switcher/#/description

posted on 2017-06-09 09:12  Sempron2800+  阅读(102)  评论(0编辑  收藏  举报