Arrays and ListsSorting, linked lists, queues, and more
Two sum problem
A popular interview question that requires you to determine if two numbers in an array sum to a specific value. A solution can be written that runs in linear time.
Print the power set of a given set
Solution for printing all possible subsets of a given set.
Find all string combinations of only 0, 1 and ?
Print all possible strings of 0's and 1's where the ? is a wildcard.
Find all duplicates in an array (version 1)
Solution for finding all duplicates in an array where the elements range from 1 to n-1.
Find all duplicates in an array (version 2)
A common interview question where your goal is to find all duplicates in an array in linear time.
Stock maximum profit
Solution that explains how to calculate the maxiumum profit that could be made in a list of stock prices.
Consecutive
For this challenge you will determine how to order an array of numbers consecutively.
3924 solutions
Solution
Permutation Step
For this challenge you will determine the next greatest number using the same numbers of a given argument.
3140 solutions
Solution
Pattern Chaser
For this challenge you will be given a string and you will have to determine whether some sort of pattern exists.
705 solutions
Solution
Gas Station
For this challenge you will be determining whether a car can get around a route with a limited amount of gas.
550 solutions
Solution
Square Figures
For this challenge you will be determining squares of certain numbers.
133 solutions
Solution
Array Jumping
For this challenge you will determine how many times you can jump around within an array.
64 solutions
Solution
Parallel Sums
For this challenge you will determine how to properly split an array into two sets.
117 solutions
Solution
Counting Anagrams
For this challenge you will determine how many anagrams exist in a string.
139 solutions
Solution
K Unique Characters
For this challenge you will be searching a string for a particular substring.
363 solutions
Solution
Maximal Rectangle
For this challenge you will be searching a matrix for the largest rectangle submatrix.
32 solutions
Solution
Dutch national flag sorting problem
Question and solution for sorting an array of 0's, 1's, and 2's in place and in linear time.
Implement bubble sort
Code for implementing the simple but slow sorting algorithm, bubble sort.
Insert an interval into a list of sorted disjoint intervals
Solution for inserting an interval into an already sorted list of disjoint intervals.
Alphabet Soup
For this challenge you will be sorting characters in a string.
21415 solutions
Solution
Switch Sort
For this challenge you will determine how quickly you can sort an array based on a specific sorting technique.
268 solutions
Solution
Wave Sorting
For this challenge you will determine if numbers in an array can be sorted in a particular way.
985 solutions
Solution
Subset sum problem
Important computer science question where the goal is to find a subset that sums to some number.
Array Addition
For this challenge you will determine if numbers in an array can add up to a certain number in the array.
4127 solutions
Solution
Array Addition I
For this challenge you will determine if numbers in an array can add up to a certain number in the array.
7965 solutions
Solution
Maximal Square
For this challenge you will be searching a matrix for the largest square submatrix.
121 solutions
Solution
Implement a queue using a linked list
Solution for how to implement a queue using a linked list data structure.
Implement a queue using two stacks
Solution for how to implement a queue using the stack data structure.
Reverse Polish Notation
This challenge will require knowledge of postfix notation for arithmetic expressions.
205 solutions
Solution
Find the middle element of a linked list
Method to find the middle element of a linked list in linear time.
Merge two sorted linked lists
Method to efficiently merge two already sorted linked lists.