Skip to content

belanasaikiran/LeetCode75

Repository files navigation

LeetCode75 🔗

Arrays/Strings

Problem Difficulty Time Complexity Space Complexity
Merge Strings Alternately Easy Solution O(n) O(1)
Greatest Common Divisor of Strings Easy Solution O(m+n+logmin(m,n)) O(m + n)
Kids With the Greatest Number of Candies Easy solution O(n) O(1)
Can Place Flowers Easy Solution O(n) O(1)
Reverse Vowels of a String Easy Solution O(log n) O(1)
Reverse Words in a String Medium Solution O(n) O(n)
Product of Array Except Self Medium Solution O(n) O(1)
Increasing Triplet Subsequence Medium Solution O(n) O(1)
String Compression Medium Solution O(n) O(1)

Two Pointers

Problem Difficulty Time Complexity Space Complexity
Move Zeroes Easy Solution O(n) O(1)
Is Subsequence Easy Solution O(n) O(1)
Container With Most Water Medium Solution O(n) O(1)
Max Number of K-Sum Pairs Medium Solution O(n log n) and O(n) O(1)

Sliding Window

Problem Difficulty Time Complexity Space Complexity
Maximum Average Subarray I Easy Solution O(n) O(1)
Maximum Number of Vowels in a Substring of Given Length Medium Solution O(n) O(1)
Max Consecutive Ones III Medium Solution O(n) O(1)
Longest Subarray of 1's After Deleting One Element Medium Solution O(n) O(1)

Prefix Sum

Problem Difficulty Time Complexity Space Complexity
Find the Highest Altitude Easy Solution O(n) O(1)
Find the Pivot Index Easy Solution O(n) O(1)

Hash Map / Set

Problem Difficulty Time Complexity Space Complexity
Find the Difference of Two Arrays Easy Solution O(n) O(1)
Unique Number of Occurrences Easy Solution O(n) O(1)
Determine if Two Strings Are Close Medium Solution O(n) O(1)
Equal Row and Column Pairs Medium Solution O(n) O(1)

Stacks

Problem Difficulty Time Complexity Space Complexity
Removing Stars From a String Medium Solution O(n) O(1)
Asteroid Collision Medium Solution O(n) O(1)
Decode String Medium Solution O(n) O(n)

Queues

Problem Difficulty Time Complexity Space Complexity Visit Again
Number of Recent Calls Easy Solution O(1) O(1)
Dota 2 Senate Medium Solution O(n) O(1) Must Redo

Linked Lists

Problem Difficulty Time Complexity Space Complexity
Delete the Middle Node of a Linked List Medium Solution O(log n) O(1)
Odd Even Linked List Medium Solution O(log n) O(1)
Reverse Linked List Easy Solution O(n) O(1)
Maximum Twin Sum of a Linked List Medium Solution O(n) O(1)

Binary Tree (DFS)

Problem Difficulty Time Complexity Space Complexity
Maximum Depth of Binary Tree Easy Solution O(n) O(1)
Leaf Similar Trees Easy Solution O(n) O(n)
Count Good Nodes in Binary Tree Medium Solution O(n) O(1)
Path Sum III Medium Solution O(n) O(n)
Longest ZigZag Path in a Binary Tree Medium Solution O(n) O(n)
Lowest Common Ancestor of a Binary Tree Medium Solution O(n) O(n)

Binary Tree (BFS)

Problem Difficulty Time Complexity Space Complexity
Binary Tree Right Side View Medium Solution O(n) O(1)
Maximum Level Sum of a Binary Tree Medium Solution O(n) O(1)

Binary Search Tree

Problem Difficulty Time Complexity Space Complexity
Search in a Binary Search Tree Easy Solution O(n) O(1)
Delete Node in a BST Medium Solution O(n) O(1)

Graphs - DFS

I need to re-do this. Too confusing. Maybe redo and understand how to solve these

Problem Difficulty Time Complexity Space Complexity
Keys and Rooms Medium Solution O(n) O(n)
Number of Provinces Medium Solution O(n) O(n)
Reorder Routes to Make All Paths Lead to the City Zero Medium Solution O(n) O(n)
Evaluate Division Medium Solution O(n) O(n)

Graphs - BFS

Problem Difficulty Time Complexity Space Complexity
Nearest Exit from Entrance in Maze Medium Solution O(m x n) O(m x n)
Rotting Oranges Medium Solution O(m x n) O(m x n)

About

My Implemenations for LeetCode 75

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages