Skip to content

319_BulbSwitcher

a920604a edited this page Apr 14, 2023 · 1 revision

title: 319. Bulb Switcher tags: - Math categories: leetcode comments: false

solution

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

analysis

  • time complexity O(1)
  • space complexity O(1)
Clone this wiki locally