Leetcode Problem 2549. Count Distinct Numbers on Board

2549. Count Distinct Numbers on Board

Leetcode Solutions

Pattern Observation Approach

  1. Check if n is equal to 1. If so, return 1 because the board will only contain the number 1 after 10^9 days.
  2. If n is greater than 1, return n - 1 because all numbers from 2 to n will eventually be on the board.
UML Thumbnail

Simulation with Set

Ask Question

Programming Language
image/screenshot of info(optional)
Full Screen
Loading...

Suggested Answer

Answer
Full Screen
Copy Answer Code
Loading...