Algorithms
Choose an algorithm to practice typing.
Searching
Sorting
Graph
Depth-First Search
mediumGiven a graph represented as an adjacency list and a starting node, traverse all reachable nodes using depth-first search. Return the list of visited nodes in order.
Breadth-First Search
mediumGiven a graph represented as an adjacency list and a starting node, traverse all reachable nodes using breadth-first search. Return the list of visited nodes in level order.
Technique
Sliding Window
mediumGiven an array of integers and a window size k, find the maximum sum of any contiguous subarray of size k. Use the sliding window technique for O(n) efficiency.
Two Pointers
easyGiven a sorted array of integers and a target sum, find two numbers that add up to the target. Return their indices. Use the two-pointer technique for O(n) efficiency.
Dynamic Programming
hardGiven an array of positive integers, find the length of the longest increasing subsequence. Use dynamic programming to solve this in O(n^2) time.
Backtracking
hardGiven an array of distinct integers, return all possible permutations. Use backtracking to explore all arrangements systematically.
Hashing
easyGiven an array of integers and a target sum, return the indices of two numbers that add up to the target. Use a hash map for O(n) lookup.