40 Kotlin coding problems, solved step by step.
Classic interview problems in our own words, each solved in Kotlin from brute force to optimal with code you can run on the page. No setup, no signup.
- Two SumEasy
- Valid ParenthesesEasy
- Contains DuplicateEasy
- Valid AnagramEasy
- Valid PalindromeEasy
- Best Time to Buy and Sell StockEasy
- Longest Common PrefixEasy
- Reverse a Linked ListEasy
- Invert a Binary TreeEasy
- Climbing StairsEasy
- Single NumberEasy
- Counting BitsEasy
- Missing NumberEasy
- Roman to IntegerEasy
- Majority ElementEasy
- Maximum Depth of a Binary TreeEasy
- Merge Two Sorted ListsEasy
- Longest Substring Without Repeating CharactersMedium
- Maximum SubarrayMedium
- 3SumMedium
- Merge IntervalsMedium
- Search in Rotated Sorted ArrayMedium
- Coin ChangeMedium
- Number of IslandsMedium
- Kth Largest Element in an ArrayMedium
- Group AnagramsMedium
- Top K Frequent ElementsMedium
- Product of Array Except SelfMedium
- Container With Most WaterMedium
- Daily TemperaturesMedium
- Jump GameMedium
- Rotate a MatrixMedium
- House RobberMedium
- Word BreakMedium
- Course ScheduleMedium
- Binary Tree Level Order TraversalMedium
- Trapping Rain WaterHard
- N-QueensHard
- Edit DistanceHard
- Largest Rectangle in HistogramHard
Coding problems, explained
Are these the official problem statements?
No. Every statement, example and test value here is written by us. The problem names are the common ones people search for, and the solutions explain the standard approaches from brute force to optimal.
Can I run the solutions?
Yes. Every approach is a complete program with a Run button that executes it on the CompileBytes engine. Edit the code and run it again to try your own inputs.
Is there a judge or a submit button?
No. These are worked solutions to read and run, not a graded test. To practise, open the compiler from any problem and write your own version before reading the answers.
Is this free? Do I need an account?
Every problem is free to read, run, edit and copy. No account is required.