Skip to content

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

License

Notifications You must be signed in to change notification settings

aminariana/leetcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tech Interview problems, solutions and explanations

Summary

A collection of LeetCode solutions to practice various programming languages, mainly java python sometimes ruby kotlin

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

Array Difficulty Tag
Kids with the Greatest Number of Candies Easy LC75
Can Place Flowers Easy LC75
Merge Sorted Array Easy* Top150
Majority Element Easy* Top150
Remove Element Easy Top150
Remove Duplicates from Sorted Array I Easy Top150
Remove Duplicates from Sorted Array II Medium Top150
Product of Array Except Self Medium LC75
Increasing Triplet Subsequence Medium LC75
Candy Hard Top150
Trapping Rain Water Hard Top150
String Difficulty Tag
Merge Strings Alternately Easy LC75
Greatest Common Divisor of Strings Easy* LC75
Reverse Vowels of a String Easy LC75
Roman to Integer Easy Top150
Integer to Roman Medium Top150
Reverse Words in a String Medium LC75
String Compression Medium LC75

Two Pointers

Two Pointers Difficulty Tag
Move Zeroes Easy LC75
Is Subsequence Easy LC75
Container With Most Water Medium LC75
Max Number of K-sum Pairs Medium LC75

Sliding Window

Sliding Window Difficulty Tag
Maximum Average Subarray I Easy LC75
Maximum Number Of Vowels In A Substring Of Given Length Medium LC75
Max Consecutive Ones III Medium LC75
Longest Subarray of 1's After Deleting One Element Medium LC75

Prefix Sum

Prefix Sum Difficulty Tag
Find the Highest Altitude Easy LC75
Find Pivot Index Easy LC75

Hashmap / Set

Hashmap / Set Difficulty Tag
Find the Difference of Two Arrays Easy LC75
Unique Number Of Occurrences Easy LC75
Determine If Two Strings Are Close Medium LC75
Equal Row and Column Pairs Medium LC75

Stack

Stack Difficulty Tag
Removing Stars from a String Medium* LC75
Asteroid Collision Medium LC75
Decode String Medium LC75

Queue

Queue Difficulty Tag
Number of Recent Calls Easy LC75
Dota2 Senate Medium LC75

Linked List

Linked List Difficulty Tag
Reverse Linked List Easy LC75
Delete The middle Node of a Linked List Medium LC75
Odd Even Linked List Medium LC75
Maximum Twin Sum of a Linked List Medium LC75

Binary Tree

Depth-First Search (DFS) Difficulty Tag
Maximum Depth of Binary Tree Easy LC75
Leaf-similar Trees Easy LC75
Count Good Nodes in Binary Tree Medium LC75
Path Sum III Medium* LC75
Longest ZigZag Path in a Binary Tree Medium LC75
Lowest Common Ancestor of a Binary Tree Medium LC75
Breadth-First Search (BFS) Difficulty Tag
Binary Tree Right Side View Medium LC75
Maximum Level Sum of a Binary Tree Medium LC75
Binary Search (BST) Difficulty Tag
Search in a Binary Search Tree Easy LC75
Delete Node in a BST Medium LC75

Graphs

Depth-First Search (DFS) Difficulty Tag
Keys and Rooms Medium LC75
Number of Provinces Medium LC75
Reorder Routes to Make All Paths Lead to the City Zero Medium LC75
Evaluate Division Medium LC75
Spreadsheet Medium Real Interview
Breadth-First Search (BFS) Difficulty Tag
Nearest Exit from Entrance in Maze Medium LC75
Rotting Oranges Medium LC75
Crawler Hard Real Interview

Heap / Priority Queue

Heap / Priority Queue Difficulty Tag
Kth Largest Element in an Array Medium LC75
Smallest Number in Infinite Set Medium LC75
Maximum Subsequence Score Medium* LC75
Total Cost to Hire K Workers Medium LC75

Binary Search

Binary Search Difficulty Tag
Guess Number Higher or Lower Easy LC75
Successful Pairs of Spells or Potions Medium LC75
Find Peak Element Medium LC75
Koko Eating Bananas Medium LC75

Backtracking

Backtracking Difficulty Tag
Letter Combinations of a Phone Number Medium LC75
Combination Sum III Medium LC75

Dynamic Programming

1 Dimensional Difficulty Tag
Nth Tribonacci Number Easy LC75
Min Cost Climbing Stairs Easy LC75
House Robber Medium LC75
Domino and Tromino Tiling Medium LC75
Multi Dimensional Difficulty Tag
Unique Paths Medium LC75
Longest Common Subsequence Medium LC75
Best Time to Buy and Sell Stock with Transaction Fee Medium* LC75
Edit Distance Medium LC75

Bit Manipulation

Bit Manipulation Difficulty Tag
Counting Bits Easy LC75
Single Number Easy LC75
Minimum Flips to Make a OR b Equal to c Medium LC75

Trie

Trie Difficulty Tag
Implement Trie (Prefix Tree) Medium LC75
Search Suggestions System Medium LC75

Intervals

Intervals Difficulty Tag
Non-overlapping Intervals Medium LC75
Minimum Number of Arrows to Burst Balloons Medium LC75

Monotonic Stack

Monotonic Stack Difficulty Tag
Daily Temperatures Medium LC75
Online Stock Span Medium LC75

Hard / Misc

LeetCode Hard Difficulty
Count of Numbers After Self Hard
Longest Consecutive Sequence Hard
Minimum Window Substring Hard
Skyline Hard
Sliding Window Maximum Hard
Sum Divisibles Hard
Wildcard Matching Hard

Legend

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

Easy Medium Hard

* 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

License

Stars

Watchers

Forks