IC 75 — The Essentials

One question per distinct pattern, nothing redundant. Our flagship 75-question plan gets you interview-ready in 3–4 weeks by covering every core pattern exactly once.

Week 1

1-bit and 2-bit Characters

easy
We have two special characters: Given a binary array bits that ends with 0, return true if the last character must be a one-bit character.

Add to Array-Form of Integer

easy
The array-form of an integer num is an array representing its digits in left to right order.

Adjacent Increasing Subarrays Detection I

easy
Given an array nums of n integers and an integer k, determine whether there exist two adjacent subarrays of length k such that both subarrays are strictly increasing.

Alternating Groups I

easy
There is a circle of red and blue tiles.

Contains Duplicate II

easy
Given an integer array nums and an integer k, return true if there are two distinct indices i and j in the array such that nums[i] == nums[j] and abs(i - j) <= k.

Count Substrings That Satisfy K-Constraint I

easy
You are given a binary string s and an integer k.

Ant on the Boundary

easy
An ant is on a boundary.

Check if All the Integers in a Range Are Covered

easy
You are given a 2D integer array ranges and two integers left and right.

Count Partitions with Even Sum Difference

easy
You are given an integer array nums of length n.

Backspace String Compare

easy
Given two strings s and t, return true if they are equal when both are typed into empty text editors.

Clear Digits

easy
You are given a string s.

Crawler Log Folder

easy
A file system keeps a log each time some user performs a change folder operation.

First Unique Character in a String

easy
Given a string s, find the first non-repeating character in it and return its index.

Number of Students Unable to Eat Lunch

easy
The school cafeteria offers circular and square sandwiches at lunch break, referred to by numbers 0 and 1 respectively.

Time Needed to Buy Tickets

easy
There are n people in a line queuing to buy tickets, where the 0th person is at the front of the line and the (n - 1)th person is at the back of the line.

Final Prices With a Special Discount in a Shop

easy
You are given an integer array prices where prices[i] is the price of the ith item in a shop.

Next Greater Element I

easy
The next greater element of some element x in an array is the first greater element that is to the right of x in the same array.

132 Pattern

medium
Given an array of n integers nums, a 132 pattern is a subsequence of three integers nums[i], nums[j] and nums[k] such that i < j < k and nums[i] < nums[k] < nums[j].

Continuous Subarrays

medium
You are given a 0-indexed integer array nums.

Count Partitions With Max-Min Difference at Most K

medium
You are given an integer array nums and an integer k.

Count Prime-Gap Balanced Subarrays

medium
You are given an integer array nums and an integer k.

Week 2

Linked List Cycle Detection

easy
Determine whether a singly-linked list loops back on itself instead of ending in null.

Merge Two Sorted Linked Lists

easy
Splice two sorted singly-linked lists together into a single sorted list.

Middle of the Linked List

easy
Find the value stored in the middle node of a singly-linked list in a single pass.

Arranging Coins

easy
You have n coins and you want to build a staircase with these coins.

Binary Search

easy
Given an array of integers nums which is sorted in ascending order, and an integer target, write a function to search target in nums.

Check If N and Its Double Exist

easy
Given an array arr of integers, check if there exist two indices i and j such that :

Delete Greatest Value in Each Row

easy
You are given an m x n matrix grid consisting of positive integers.

Final Array State After K Multiplication Operations I

easy
You are given an integer array nums, an integer k, and an integer multiplier.

Find Subsequence of Length K With the Largest Sum

easy
You are given an integer array nums and an integer k.

Apple Redistribution into Boxes

easy
You are given an array apple of size n and an array capacity of size m.

Array Partition

easy
Given an integer array nums of 2n integers, group these integers into n pairs (a1, b1), (a2, b2), ..., (an, bn) such that the sum of min(ai, bi) for all i is maximized.

Assign Cookies

easy
Assume you are an awesome parent and want to give your children some cookies.

Count Prefix and Suffix Pairs I

easy
You are given a 0-indexed string array words.

Longest Common Prefix

easy
Write a function to find the longest common prefix string amongst an array of strings.

Maximum Strong Pair XOR I

easy
You are given a 0-indexed integer array nums.

Get All Root-to-Leaf Paths

easy
Return every root-to-leaf path in a binary tree as a list of node values, instead of an arrow-joined string.

Binary Tree Paths

easy
Return every root-to-leaf path in a binary tree as an arrow-joined string.

Binary Watch

easy
A binary watch has 4 LEDs on the top to represent the hours (0-11), and 6 LEDs on the bottom to represent the minutes (0-59).

Week 3

Binary Tree Basics

easy
An introduction to the Node and BinTree building blocks used throughout the Binary Trees series, plus a sample tree these exercises build on.

Binary Tree Traversals: Preorder, Inorder, Postorder

easy
Add preorder, inorder, and postorder traversal methods to BinTree and see how each visits the same sample tree in a different order.

Convert a Sorted Array to a Balanced BST

easy
Build a height-balanced binary search tree from an array sorted in ascending order.

Find if Path Exists in Graph

easy
There is a bi-directional graph with n vertices, where each vertex is labeled from 0 to n - 1 (inclusive).

Flood Fill

easy
You are given an image represented by an m x n grid of integers image, where image[i][j] represents the pixel value of the image.

Island Perimeter

easy
You are given row x col grid representing a map where grid[i][j] = 1 represents land and grid[i][j] = 0 represents water.

01 Matrix

medium
Given an m x n binary matrix mat, return the distance of the nearest 0 for each cell.

Accounts Merge

medium
Given a list of accounts where each element accounts[i] is a list of strings, where the first element accounts[i][0] is a name, and the rest of the elements are emails...

All Paths From Source to Target

medium
Given a directed acyclic graph (DAG) of n nodes labeled from 0 to n - 1, find all possible paths from node 0 to node n - 1 and return them in any order.

Find Center of Star Graph

easy
There is an undirected star graph consisting of n nodes labeled from 1 to n.

Find the Town Judge

easy
In a town, there are n people labeled from 1 to n.

Cheapest Flights Within K Stops

medium
There are n cities connected by some number of flights.

Course Schedule

medium
There are a total of numCourses courses you have to take, labeled from 0 to numCourses - 1.

Course Schedule II

medium
There are a total of numCourses courses you have to take, labeled from 0 to numCourses - 1.

Course Schedule IV

medium
There are a total of numCourses courses you have to take, labeled from 0 to numCourses - 1.

Check if There is a Valid Path in a Grid

medium
You are given an m x n grid.

Count Islands With Total Value Divisible by K

medium
You are given an m x n matrix grid and a positive integer k.

Count Servers that Communicate

medium
You are given a map of a server center, represented as a m * n integer matrix grid, where 1 means that on that cell there is a server and 0 means that it is no server.

Week 4

Digit Operations to Make Two Integers Equal

medium
You are given two integers n and m that consist of the same number of digits.

Evaluate Division

medium
You are given an array of variable pairs equations and an array of real numbers values, where equations[i] = [Ai, Bi] and values[i] represent the equation Ai / Bi = values[i].

Find a Safe Walk Through a Grid

medium
You are given an m x n binary matrix grid and an integer health.

Min Cost to Connect All Points

medium
You are given an array points representing integer coordinates of some points on a 2D-plane, where points[i] = [xi, yi].

Find Critical and Pseudo-Critical Edges in Minimum Spanning Tree

hard
Given a weighted undirected connected graph with n vertices numbered from 0 to n - 1, and an array edges where edges[i] = [ai, bi, weighti] represents a bidirectional and weighted...

Maximize Spanning Tree Stability with Upgrades

hard
You are given an integer n, representing n nodes numbered from 0 to n - 1 and a list of edges, where edges[i] = [ui, vi, si, musti]: You are also given an integer k, the maximum...

Cracking the Safe

hard
There is a safe protected by a password.

Critical Connections in a Network

hard
There are n servers numbered from 0 to n - 1 connected by undirected server-to-server connections forming a network where connections[i] = [ai, bi] represents a connection between...

Minimum Edge Weight Equilibrium Queries in a Tree

hard
There is an undirected tree with n nodes labeled from 0 to n - 1.

Best Time to Buy and Sell Stock

easy
You are given an array prices where prices[i] is the price of a given stock on the ith day.

Climbing Stairs

easy
You are climbing a staircase.

Counting Bits

easy
Given an integer n, return an array ans of length n + 1 such that for each i (0 <= i <= n), ans[i] is the number of 1's in the binary representation of i.

Fruits Into Baskets II

easy
You are given two arrays of integers, fruits and baskets, each of length n, where fruits[i] represents the quantity of the ith type of fruit, and baskets[j] represents the...

Count Number of Teams

medium
There are n soldiers standing in a line.

Fruits Into Baskets III

medium
You are given two arrays of integers, fruits and baskets, each of length n, where fruits[i] represents the quantity of the ith type of fruit, and baskets[j] represents the...

Count Number of Rectangles Containing Each Point

medium
You are given a 2D integer array rectangles where rectangles[i] = [li, hi] indicates that ith rectangle has a length of li and a height of hi.

Maximum Area Rectangle With Point Constraints I

medium
You are given an array points where points[i] = [xi, yi] represents the coordinates of a point on an infinite plane.

Number of Longest Increasing Subsequence

medium
Given an integer array nums, return the number of longest increasing subsequences.