Skip to content

Strings, Math, And Counting 01

This pack is for symbolic pattern switching: string borders, modular reasoning, and combinatorial counting in one sitting.

Who This Is For

Use this pack if:

  • you already know at least one string matching technique
  • modular exponentiation and basic combinatorics are familiar, but slow to recall under pressure
  • you want a round where recognition matters more than heavy implementation

Entry Gate

Try this pack only if these already feel like review:

Pack Shape

  • Type: review and switching drill
  • Topic mix: KMP + Z-function + modular arithmetic + counting basics + inclusion-exclusion
  • Problems: 5
  • Suggested time: 2.5-3.5 hours

Topics Under Test

  • recognizing fallback-table string scans
  • turning prefix/suffix alignment into one linear-time check
  • reducing exponents before computing powers
  • mapping a story directly to a counting model
  • keeping inclusion-exclusion signs and overflow guards disciplined

Suggested Order

Slot Problem Topic Why it is here
1 String Matching KMP Starts with one crisp pattern-matching engine and overlap handling.
2 Finding Periods Z-function Keeps you in strings but changes the recognition cue from matching to periodicity.
3 Exponentiation II Modular arithmetic Breaks the string rhythm with one algebraic reduction problem.
4 Distributing Apples Stars and bars Switches from formula manipulation to direct counting-model recognition.
5 Prime Multiples Inclusion-exclusion Finishes with a subset-sign problem where the main risk is logical drift, not code length.

How To Run It

  • solve in order so the round alternates between symbolic string reasoning and arithmetic/counting reasoning
  • keep one scratch line per slot: first wrong instinct
  • if recognition is still fuzzy after about 12-15 minutes, allow one refresher page but not the solved note
  • if one slot still feels dead after about 25-30 minutes, move on and return only during debrief

Allowed Refreshers

Debrief

After the pack, write down:

  1. Which slot you recognized fastest, and what cue triggered it.
  2. Whether your string slots felt more mechanical or more conceptual than the counting slots.
  3. Which formula or invariant you should now be able to restate without reopening the note.

Go Back Next