Count Distinct Numbers on Board Problem

Count Distinct Numbers on Board Problem — ExecCode Easy DSA Practice

Solve the Count Distinct Numbers on Board problem on ExecCode. Free online easy DSA practice in Arrays - Logic Building. Write and run code in Java, C++, Python — no signup required to run.

Problem description

Description You are given a positive integer n, that is initially placed on a board. Your task is to - For each number x present on the board, find all numbers 1 <= i <= n such that x % i == 1. Every day, for 10^9 days, you perform the following procedure: - Then, place those numbers on the board. Return the number of distinct integers present on the board after 10^9 days have elapsed.

Examples

Input {"n": 5}; Output 4. Input {"n": 3}; Output 2

Constraints

1 <= n <= 100

Practice Count Distinct Numbers on Board free on ExecCode. Browse DSA problems, topic map, and placement guides.