../

Leetcode Map of Contents

Takeaways

Arrays and Hashing

  • Check if the number of elements has a bound. For example if you are operating on alphabets you know that there are only 26 alphabets. You don’t have to hash them. You can directly map them to an array.
  • Hashing is used wherever you want a $O(1)$ find() operation. This trades in memory for runtime
  • Look for memoizing opportunities. If you are able to store the result in a hash-table, then you can reuse them for other element. Many problems have subproblems that can be used. Especially in $O(n)$ cases where we cannot sort.

Log

2026-03-06

2025-08-21

2025-08-27

2025-08-29