Member-only story
My LeetCode Journey to Become a Better Problem Solver (Day 2)
Today, I’m diving into the easy-level problem on Leetcode — Linked List Frequency on LeetCode.
This problem can be solved with hash table.
The Problem
What is hash table?
For example in Python we don't need to implement hash table, because it's a dictionary.
Let's discuss how it works. Before we start we need a little bit terminlogy. If the load factor is higher than 0.75 we should increase the capacity.
- Load factor — a measure of how full the hash table is allowed to get before its capacity is automatically increased
- Capacity — the number of buckets in the hash table
We need a hash function that consistently maps a string to a number. This means that every time you input programmer
you will get the same number back.