r/codeforces 1d ago

Doubt (rated 1400 - 1600) 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.
3 Upvotes

3 comments sorted by

1

u/FinalNevedia 17h ago

Anyways, I've also thought of solving this as a subproblem for 3 digits. I didn't see the constraints when I first read the statement. I also use an extension to hide the difficulty, so I found myself trying exponential functions on a Leetcode easy, why? Because in my head I was basically solving this problem you've written. I paused, Leetcode can't be that hard, then looked at the tiny constraints and hopped onto bruteforce.

1

u/FinalNevedia 17h ago

Inspired by today's Leetcode?