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
easyWe 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
easyThe array-form of an integer num is an array representing its digits in left to right order.
Adjacent Increasing Subarrays Detection I
easyGiven 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
easyThere is a circle of red and blue tiles.
Contains Duplicate II
easyGiven 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
easyYou are given a binary string s and an integer k.
Ant on the Boundary
easyAn ant is on a boundary.
Check if All the Integers in a Range Are Covered
easyYou are given a 2D integer array ranges and two integers left and right.
Count Partitions with Even Sum Difference
easyYou are given an integer array nums of length n.
Backspace String Compare
easyGiven two strings s and t, return true if they are equal when both are typed into empty text editors.
Clear Digits
easyYou are given a string s.
Crawler Log Folder
easyA file system keeps a log each time some user performs a change folder operation.
First Unique Character in a String
easyGiven a string s, find the first non-repeating character in it and return its index.
Number of Students Unable to Eat Lunch
easyThe school cafeteria offers circular and square sandwiches at lunch break, referred to by numbers 0 and 1 respectively.
Time Needed to Buy Tickets
easyThere 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
easyYou are given an integer array prices where prices[i] is the price of the ith item in a shop.
Next Greater Element I
easyThe 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
mediumGiven 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
mediumYou are given a 0-indexed integer array nums.
Count Partitions With Max-Min Difference at Most K
mediumYou are given an integer array nums and an integer k.
Count Prime-Gap Balanced Subarrays
mediumYou are given an integer array nums and an integer k.
Week 2
Linked List Cycle Detection
easyDetermine whether a singly-linked list loops back on itself instead of ending in null.
Merge Two Sorted Linked Lists
easySplice two sorted singly-linked lists together into a single sorted list.
Middle of the Linked List
easyFind the value stored in the middle node of a singly-linked list in a single pass.
Arranging Coins
easyYou have n coins and you want to build a staircase with these coins.
Binary Search
easyGiven 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
easyGiven an array arr of integers, check if there exist two indices i and j such that :
Delete Greatest Value in Each Row
easyYou are given an m x n matrix grid consisting of positive integers.
Final Array State After K Multiplication Operations I
easyYou are given an integer array nums, an integer k, and an integer multiplier.
Find Subsequence of Length K With the Largest Sum
easyYou are given an integer array nums and an integer k.
Apple Redistribution into Boxes
easyYou are given an array apple of size n and an array capacity of size m.
Array Partition
easyGiven 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
easyAssume you are an awesome parent and want to give your children some cookies.
Count Prefix and Suffix Pairs I
easyYou are given a 0-indexed string array words.
Longest Common Prefix
easyWrite a function to find the longest common prefix string amongst an array of strings.
Maximum Strong Pair XOR I
easyYou are given a 0-indexed integer array nums.
Get All Root-to-Leaf Paths
easyReturn every root-to-leaf path in a binary tree as a list of node values, instead of an arrow-joined string.
Binary Tree Paths
easyReturn every root-to-leaf path in a binary tree as an arrow-joined string.
Binary Watch
easyA 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
easyAn 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
easyAdd 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
easyBuild a height-balanced binary search tree from an array sorted in ascending order.
Find if Path Exists in Graph
easyThere is a bi-directional graph with n vertices, where each vertex is labeled from 0 to n - 1 (inclusive).
Flood Fill
easyYou 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
easyYou 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
mediumGiven an m x n binary matrix mat, return the distance of the nearest 0 for each cell.
Accounts Merge
mediumGiven 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
mediumGiven 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
easyThere is an undirected star graph consisting of n nodes labeled from 1 to n.
Find the Town Judge
easyIn a town, there are n people labeled from 1 to n.
Cheapest Flights Within K Stops
mediumThere are n cities connected by some number of flights.
Course Schedule
mediumThere are a total of numCourses courses you have to take, labeled from 0 to numCourses - 1.
Course Schedule II
mediumThere are a total of numCourses courses you have to take, labeled from 0 to numCourses - 1.
Course Schedule IV
mediumThere 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
mediumYou are given an m x n grid.
Count Islands With Total Value Divisible by K
mediumYou are given an m x n matrix grid and a positive integer k.
Count Servers that Communicate
mediumYou 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
mediumYou are given two integers n and m that consist of the same number of digits.
Evaluate Division
mediumYou 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
mediumYou are given an m x n binary matrix grid and an integer health.
Min Cost to Connect All Points
mediumYou 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
hardGiven 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
hardYou 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
hardThere is a safe protected by a password.
Critical Connections in a Network
hardThere 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
hardThere is an undirected tree with n nodes labeled from 0 to n - 1.
Best Time to Buy and Sell Stock
easyYou are given an array prices where prices[i] is the price of a given stock on the ith day.
Climbing Stairs
easyYou are climbing a staircase.
Counting Bits
easyGiven 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
easyYou 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
mediumThere are n soldiers standing in a line.
Fruits Into Baskets III
mediumYou 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
mediumYou 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
mediumYou 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
mediumGiven an integer array nums, return the number of longest increasing subsequences.