Skip to content

hstoklosa/leetcode

Repository files navigation

hstoklosa/leetcode

A collection of my solutions to LeetCode problems, organised by common patterns/techniques and prioritised by topics that appear most frequently in technical interviews.

Source: algo.monster/problems/stats

Resources

 Recognising patterns

   IF INPUT ARRAY IS SORTED THEN

  •  Binary search
  •  Two pointers

   IF ASKED FOR ALL PERMUTATIONS/SUBSETS THEN

  •  Backtracking

   IF GIVEN A TREE THEN

  •  DFS
  •  BFS

   IF GIVEN A GRAPH THEN

  •  DFS
  •  BFS

   IF GIVEN A LINKED LIST THEN

  •  Two pointers

   IF RECURSION IS BANNED THEN

  •  Stack

   IF MUST SOLVE IN-PLACE THEN

  •  Swap corresponding values
  •  Store one or more different values in the same pointer

   IF ASKED FOR MAXIMUM/MINIMUM SUBARRAY/SUBSET/OPTIONS THEN

  •  Dynamic programming

   IF ASKED FOR TOP/LEAST K ITEMS THEN

  •  Heap
  •  QuickSelect

   IF ASKED FOR COMMON STRINGS THEN

  •  Map
  •  Trie

   ELSE

  •  Map/Set for O(1) time & O(n) space
  •  Sort input for O(nlogn) time and O(1) space

 Leetcode articles
 Other links

About

Solutions to Leetcode problems

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages