Array Hash Table Math Simulation 2549. Count Distinct Numbers on Board¶ Time: $O(1)$ Space: $O(1)$ C++JavaPython 1 2 3 4 5 6class Solution { public: int distinctIntegers(int n) { return max(n - 1, 1); } }; 1 2 3 4 5class Solution { public int distinctIntegers(int n) { return Math.max(n - 1, 1); } } 1 2 3class Solution: def distinctIntegers(self, n: int) -> int: return max(n - 1, 1) Was this page helpful? Thanks for your feedback! Thanks for your feedback! Help us improve this page by using our feedback form.