Skip to content

Counting problems,
and the tell.

The answer is how many, and the items repeat. 91 problems in the catalogue carry this tag, from first-week easy to interview hard.

Free to start. Running and submitting a solution never costs credits.

How the pattern actually works.

One mechanism, and the mistake that costs people the problem.

The tell. The answer is how many, and the items repeat.

The mechanism. Count first, reason second. A frequency map or a fixed array of counts turns most of these into arithmetic on the counts rather than another walk over the data.

What goes wrong. Counting pairs twice. If order does not matter, divide, or only count forward.

The ones asked most often.

By how often the catalogue records them being set, not by our opinion.

  1. Number of Divisible SubstringsMediumasked at 4 companies
  2. Rank Teams by VotesMediumasked at 4 companies
  3. Largest Palindromic NumberMediumasked at 3 companies
  4. Maximum Number of Balls in a BoxEasyasked at 2 companies
  5. Construct String With Repeat LimitMediumasked at 2 companies
  6. Count Elements With Maximum FrequencyEasyasked at 2 companies
  7. Check If Array Pairs Are Divisible by kMediumasked at 2 companies
  8. Find Players With Zero or One LossesMediumasked at 2 companies
  9. Longest Harmonious SubsequenceEasyasked at 2 companies
  10. Maximum Number of Pairs in ArrayEasyasked at 1 companies

Read it, watch it, then solve it.

The order that makes a pattern stick.

Everything in the app, in one place.

Practice, interviews and the tools, all free to start. Swipe to see the rest.

Free to start: 100 AI credits when you sign up and 100 every month. Start free in the app

About counting problems.

Free to start, no card.

Start practising
How do I know a problem is a counting problem?

The answer is how many, and the items repeat.

How many counting problems should I solve?

Enough to stop needing the hint, which is usually ten to fifteen across the levels, not the whole list. The catalogue tags 91, split roughly 32 easy, 53 medium and 6 hard in the sample we show, so work up rather than across.

What goes wrong most often in counting problems?

Counting pairs twice. If order does not matter, divide, or only count forward.

Is practising by pattern better than a problem sheet?

A sheet tells you what to solve. A pattern tells you why those problems sit together, which is the part that carries over to the problem you have not seen. That is why the app files every problem under its pattern.