Skip to content
Back to libraryPart 1 · Foundations

1.4Counting and frequency

Before you start

It helps to have read 1.3 Arrays and strings. Overall level: Foundation.

Practice: Counting and frequency

0 of 4 solved

About these problems

Apply, Connect, Reason and Stretch describe difficulty within this topic, not an official contest rating. Open any problem in any order; reading the chapter first is optional.

  1. 1Alphabet tallyCount the occurrences of each lowercase English letter in a string.ApplyNot started
  2. 2Most common readingFind the value appearing most often. If several values tie, print the smallest of them.ConnectNot started
  3. 3Rearrange the labelDecide whether one lowercase string can be rearranged to equal another. Every character must be used exactly once.ReasonNot started
  4. 4Equal-reading pairsCount pairs of positions i<j whose values are equal.StretchNot started

Read the lesson