[AtCoder] C - Large RPS TournamentRead more
[AtCoder] B - logRead more
[AtCoder] C - ExoswapRead more
[AtCoder] B - Many 110Read more
[Codeforces] MemSQL Start[c]UP 3.0 - Round 2 (onsite finalists) A. Save the problem!Read more
[Kick Start 2022 Round D] Image LabelerRead more
[Kick Start 2022 Round D] Maximum GainRead more
[Kick Start 2022 Round D] Touchbar TypingRead more
[Kick Start 2022 Round D] Suspects and WitnessesRead more
[LeetCode] Count the Number of Ideal Arrays

2338. Count the Number of Ideal Arrays

You are given two integers n and maxValue, which are used to describe an ideal array.

A 0-indexed integer array arr of length n is considered ideal if the following conditions hold:

  • Every arr[i] is a value from 1 to maxValue, for 0 <= i < n.
  • Every arr[i] is divisible by arr[i - 1], for 0 < i < n.

Return the number of distinct ideal arrays of length n. Since the answer may be very large, return it modulo 109 + 7.

Read more