bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths
Beginner track

First 20 puzzles

A guided path from reading small code fragments into arrays, strings, and hash maps.

0 of 20 done0%

Read code one line at a time

Variables, branches, loops, and return values before heavier data-structure choices.

0 / 5
  1. 1Create a valueContains Duplicate - Recognize that a variable can hold a helper object.
  2. 2Read a return valueBest Time to Buy And Sell Stock - Follow a tiny function from setup to return.Open
  3. 3Complete a base caseClimbing Stairs - Notice the simple case before the loop starts.Open
  4. 4Trace a branchBinary Search - Track what changes after each comparison.Open
  5. 5Read a conditionValid Palindrome - Use the loop boundary and final return together.Open

Move through arrays

Index positions, running state, and simple scans.

0 / 5
  1. 6Use an array valueTwo Sum - Connect the current number to a target.Open
  2. 7Keep a running bestBest Time to Buy And Sell Stock - Track one useful value while scanning prices.Open
  3. 8Find the wrong branch resultContains Duplicate - A condition can be correct while the returned value is wrong.Open
  4. 9Trace an index answerTwo Sum - Follow how a lookup turns into returned indexes.Open
  5. 10Pick a boundary testContainer With Most Water - Choose an input that proves pointer movement works.Open

Work with strings

Characters, cleanup, comparison, and encoded structure.

0 / 5
  1. 11Count charactersValid Anagram - Treat a string as a sequence of characters.Open
  2. 12Catch an off-by-one string bugValid Palindrome - String indexes stop at length minus one.Open
  3. 13Test encoded stringsEncode and Decode Strings - Notice why empty strings and delimiters matter.Open
  4. 14Predict string logicValid Anagram - Read a small string example without memorizing the problem.Open
  5. 15Choose the grouping signalGroup Anagrams - Find the representation that makes equal strings comparable.Open

Store what you have seen

Sets and maps as memory for duplicates, counts, and lookups.

0 / 5
  1. 16Trace a setContains Duplicate - A set remembers which values appeared earlier.Open
  2. 17Fix the lookup keyTwo Sum - Maps only work when you store values under the key you later search for.Open
  3. 18Build groupsGroup Anagrams - Use a map entry to collect matching strings.Open
  4. 19Count frequencyTop K Frequent Elements - A map can count how often each value appears.Open
  5. 20Fix a count comparisonValid Anagram - Zero means balanced; below zero means too many.Open