Two Sum
Return the indices of two numbers whose sum matches a target.
Practice
Solve Kotlin interview problems in a focused workspace with a timer and AI-powered review after every submission.
Return the indices of two numbers whose sum matches a target.
Check whether a string of brackets is balanced.
Merge two sorted linked lists into one sorted list.
Find the maximum profit from one buy and one sell.
Detect whether any value appears at least twice.
Build an output array where each index holds the product of all other elements.
Find the contiguous subarray with the largest sum.
Find the contiguous subarray with the maximum product.
Find the minimum value in a rotated sorted array with unique values.
Search a target in a rotated sorted array.
Find all unique triplets that sum to zero.
Choose two lines that hold the most water.
Compute a + b without using + or -.
Count how many set bits appear in an integer.
Return the bit count for every number from 0 to n.
Find the missing number from 0..n.
Reverse the bit order of a 32-bit unsigned integer.
Count how many ways to climb to the top taking 1 or 2 steps.
Find the minimum number of coins to reach an amount.
Return the length of the longest strictly increasing subsequence.
Find the length of the longest common subsequence of two strings.
Determine if a string can be segmented into dictionary words.
Return all combinations of candidates that sum to a target.
Maximize robbed money without taking adjacent houses.
House Robber with houses arranged in a circle.
Count how many ways a digit string can be decoded.
Count robot paths from top-left to bottom-right in a grid.
Determine if you can reach the last index.
Deep-copy a connected graph.
Check if all courses can be completed given prerequisites.
Find all cells that can flow to both oceans.
Count how many connected land masses exist in a grid.
Find the longest run of consecutive integers.
Infer a character ordering from a sorted alien dictionary.
Check whether an undirected graph is a tree.
Count connected components in an undirected graph.
Insert a new interval into sorted non-overlapping intervals.
Merge all overlapping intervals.
Remove the minimum number of intervals to eliminate overlaps.
Check if a person can attend all meetings.
Compute the minimum number of meeting rooms required.
Reverse a singly linked list.
Detect whether a linked list contains a cycle.
Merge many sorted linked lists into one sorted list.
Remove the nth node from the end in one pass.
Reorder a list by alternating front and back nodes.
Set rows and columns to zero when a cell is zero.
Return matrix elements in spiral order.
Rotate an n x n matrix 90 degrees clockwise in place.
Find whether a word exists in a board by adjacent traversal.
Find the longest substring with all unique characters.
Maximize repeating characters by replacing at most k characters.
Find the smallest substring containing all target characters.
Check whether two strings are anagrams.
Group words that are anagrams of each other.
Check if a string is a palindrome ignoring punctuation and case.
Count all palindromic substrings.
Find the longest palindromic substring.
Encode a list of strings to one string and decode it back.
Return the height of a binary tree.
Check whether two binary trees are structurally identical.
Swap left and right children throughout a tree.
Find the maximum path sum anywhere in a binary tree.
Traverse a tree level by level.
Convert a binary tree to a string and back.
Check whether one tree is a subtree of another.
Reconstruct a binary tree from preorder and inorder traversals.
Check whether a binary tree satisfies BST rules.
Find the kth smallest value in a BST.
Find the lowest common ancestor of two nodes in a BST.
Return the k most frequent elements.
Maintain a running median as numbers are inserted.
Return the k points closest to the origin.
Schedule tasks with cooling intervals.
Build a trie supporting insert, search, and prefix queries.
Trie with wildcard search.
Find all dictionary words present in a board.
Find the shortest transformation sequence length between words.
Find the maximum XOR value of any pair in the array.
Find the repeated number without modifying the array.
Return the maximum in every window of size k.
Design a stack that can return the minimum in constant time.
Evaluate an arithmetic expression in postfix notation.
Generate all valid parenthesis strings of length 2n.
Find how many days until a warmer temperature.
Count how many car fleets reach the target.
Find the largest rectangle area in a histogram.
Search for a target in a row-wise sorted matrix.
Store values by timestamp and query the latest valid one.
Find the median of two sorted arrays in logarithmic time.