Member-only story

My LeetCode Journey to Become a Better Problem Solver (Day 2)

Tomas Svojanovsky
4 min readMay 20, 2024

--

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
Basic terminology

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.

hash function example

--

--

Tomas Svojanovsky
Tomas Svojanovsky

Written by Tomas Svojanovsky

I'm a full-stack developer. Programming isn't just my job but also my hobby. I like developing seamless user experiences and working on server-side complexities

No responses yet