Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 2549. Count Distinct Numbers on Board
Starting from n, repeatedly add any i in [1,n] for which some current board value x satisfies x % i == 1, and after many iterations return the number of distinct integers present. Equivalently, compute the size of the reachability/closure set in a directed graph with edges x → i whenever x % i == 1 (n ≤ 100).
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.