Skip to content

Latest commit

History

180 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Tech Interview problems, solutions and explanations

Summary

A collection of LeetCode solutions to practice various programming languages, mainly javapython sometimes rubykotlin

Problem set

LeetCode+75

Top+Interview+150

Hard+20 (Part of Top 150)

Real Interview

Approach

Follow each problem link to to see its description, solution and explanation. The solution may appear in multiple languages, just for fun.

Problem category

Array / String

ArrayDifficultyTag
Kids with the Greatest Number of CandiesEasyLC75
Can Place FlowersEasyLC75
Merge Sorted ArrayEasy*Top150
Majority ElementEasy*Top150
Remove ElementEasyTop150
Remove Duplicates from Sorted Array IEasyTop150
Remove Duplicates from Sorted Array IIMediumTop150
Product of Array Except SelfMediumLC75
Increasing Triplet SubsequenceMediumLC75
CandyHardTop150
Trapping Rain WaterHardTop150
StringDifficultyTag
Merge Strings AlternatelyEasyLC75
Greatest Common Divisor of StringsEasy*LC75
Reverse Vowels of a StringEasyLC75
Roman to IntegerEasyTop150
Integer to RomanMediumTop150
Reverse Words in a StringMediumLC75
String CompressionMediumLC75

Two Pointers

Two PointersDifficultyTag
Move ZeroesEasyLC75
Is SubsequenceEasyLC75
Container With Most WaterMediumLC75
Max Number of K-sum PairsMediumLC75

Sliding Window

Sliding WindowDifficultyTag
Maximum Average Subarray IEasyLC75
Maximum Number Of Vowels In A Substring Of Given LengthMediumLC75
Max Consecutive Ones IIIMediumLC75
Longest Subarray of 1's After Deleting One ElementMediumLC75

Prefix Sum

Prefix SumDifficultyTag
Find the Highest AltitudeEasyLC75
Find Pivot IndexEasyLC75

Hashmap / Set

Hashmap / SetDifficultyTag
Find the Difference of Two ArraysEasyLC75
Unique Number Of OccurrencesEasyLC75
Determine If Two Strings Are CloseMediumLC75
Equal Row and Column PairsMediumLC75

Stack

StackDifficultyTag
Removing Stars from a StringMedium*LC75
Asteroid CollisionMediumLC75
Decode StringMediumLC75

Queue

QueueDifficultyTag
Number of Recent CallsEasyLC75
Dota2 SenateMediumLC75

Linked List

Linked ListDifficultyTag
Reverse Linked ListEasyLC75
Delete The middle Node of a Linked ListMediumLC75
Odd Even Linked ListMediumLC75
Maximum Twin Sum of a Linked ListMediumLC75

Binary Tree

Depth-First Search (DFS)DifficultyTag
Maximum Depth of Binary TreeEasyLC75
Leaf-similar TreesEasyLC75
Count Good Nodes in Binary TreeMediumLC75
Path Sum IIIMedium*LC75
Longest ZigZag Path in a Binary TreeMediumLC75
Lowest Common Ancestor of a Binary TreeMediumLC75
Breadth-First Search (BFS)DifficultyTag
Binary Tree Right Side ViewMediumLC75
Maximum Level Sum of a Binary TreeMediumLC75
Binary Search (BST)DifficultyTag
Search in a Binary Search TreeEasyLC75
Delete Node in a BSTMediumLC75

Graphs

Depth-First Search (DFS)DifficultyTag
Keys and RoomsMediumLC75
Number of ProvincesMediumLC75
Reorder Routes to Make All Paths Lead to the City ZeroMediumLC75
Evaluate DivisionMediumLC75
SpreadsheetMediumReal Interview
Breadth-First Search (BFS)DifficultyTag
Nearest Exit from Entrance in MazeMediumLC75
Rotting OrangesMediumLC75
CrawlerHardReal Interview

Heap / Priority Queue

Heap / Priority QueueDifficultyTag
Kth Largest Element in an ArrayMediumLC75
Smallest Number in Infinite SetMediumLC75
Maximum Subsequence ScoreMedium*LC75
Total Cost to Hire K WorkersMediumLC75

Binary Search

Binary SearchDifficultyTag
Guess Number Higher or LowerEasyLC75
Successful Pairs of Spells or PotionsMediumLC75
Find Peak ElementMediumLC75
Koko Eating BananasMediumLC75

Backtracking

BacktrackingDifficultyTag
Letter Combinations of a Phone NumberMediumLC75
Combination Sum IIIMediumLC75

Dynamic Programming

1 DimensionalDifficultyTag
Nth Tribonacci NumberEasyLC75
Min Cost Climbing StairsEasyLC75
House RobberMediumLC75
Domino and Tromino TilingMediumLC75
Multi DimensionalDifficultyTag
Unique PathsMediumLC75
Longest Common SubsequenceMediumLC75
Best Time to Buy and Sell Stock with Transaction FeeMedium*LC75
Edit DistanceMediumLC75

Bit Manipulation

Bit ManipulationDifficultyTag
Counting BitsEasyLC75
Single NumberEasyLC75
Minimum Flips to Make a OR b Equal to cMediumLC75

Trie

TrieDifficultyTag
Implement Trie (Prefix Tree)MediumLC75
Search Suggestions SystemMediumLC75

Intervals

IntervalsDifficultyTag
Non-overlapping IntervalsMediumLC75
Minimum Number of Arrows to Burst BalloonsMediumLC75

Monotonic Stack

Monotonic StackDifficultyTag
Daily TemperaturesMediumLC75
Online Stock SpanMediumLC75

Hard / Misc

LeetCode HardDifficulty
Count of Numbers After SelfHard
Longest Consecutive SequenceHard
Minimum Window SubstringHard
SkylineHard
Sliding Window MaximumHard
Sum DivisiblesHard
Wildcard MatchingHard

Legend

You will find these badges on top of each problem page:

EasyMediumHard

* Asterisk indicates disputed difficulty.

About

Collection of hundreds of LeetCode style Interview questions and my solutions in multiple languages (for fun and self-training). Feel free to fork.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Used by

Contributors

Languages