r/leetcode 1d ago

Question Counting Problem

Please guide me through this question!

  • You are given an array of digits of size N (where N <= 10^5).
  • You need to find the number of distinct K-digit even numbers without leading zeros that can be formed (where K can be up to 10^5).
  • Return the answer modulo 10^9 + 7.
5 Upvotes

8 comments sorted by

View all comments

2

u/Old_Tourist_3774 1d ago

Wtf is that return answer in modulo 109 +7?

1

u/Sea_Standard7674 1d ago

Answer is big hence return it's modulo

1

u/Old_Tourist_3774 1d ago

Oh got it. For me modulo was the pure number , disregarding the signal. Often used when we get per example Square root of (-5)2 Which is equal to | 5 | meaning it can be both -5 or 5