Skip to content

Contains all my submissions for the 31 Day - LeetCode May'20 coding challenge

License

Notifications You must be signed in to change notification settings

raghavsikaria/LeetCode-31-day-May-2020-Challenge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My adventure with the viral LeetCode Monthly - Code Everyday Challenge - May'20 Edition

So one fine day(30st April 2020), I casually open LinkedIn and my feed is filled with posts from people who have completed some LeetCode April 30 Day Challenge which was made viral by Akshay Saini. The more such posts I saw, the more it intrigued me. I was alot into Competitive Coding in my college days(back till '17) and coded mostly on Hackerrank (my profile) eventually making it into top 300 globally (Problem Solving/Algorithm Practice domain). And now, after 2+ years of corporate monotony, my rusty self recalls this now modified famous quote from someone:

Coding/Algorithm problem solving is like brushing, and if you don't brush daily - you know what happens! --anonymous

I jumped at this opportunity hoping to get that algorithmic mojo back, and in this repository as Akshay suggested fellow developers on LinkedIn to actively maintain a repo of all solutions, I am maintaining all of my submissions from the challenge.

Hope it's of use to anyone out there!

Submissions

Summary

# Problem Algorithm Data Structure Time Complexity Space Complexity
1 First Bad Version - Code Binary Search O(logn) O(1)
2 Jewels and Stones - Code Frequency Array Array O(n) O(1)
3 Ransom Note - Code Frequency Array Array O(n) O(1)
4 Number Complement - Code Array O(logn) O(1)
5 First Unique Character in a String - Code Frequency Array Array O(n) O(1)
6 Majority Element - Code Boyer Moore Majority Vote O(n) O(1)
7 Cousins in Binary Tree - Code O(n) O(1)
8 Check if it is a straight line - Code O(n) O(1)
9 Valid perfect square - Code Binary Search O(logn) O(1)
10 Find the town judge - Code Frequency Array O(n) O(n)
11 Flood Fill - Code Flood Fill Recursion/BFS Queue O(n^2) O(n^2)
12 Single element in sorted array - Code Binary Search O(logn) O(1)
13 Remove k digits - Code Stack O(n) O(n)
14 Implement Trie - Code Trie
15 Maximum Sum Circular Subarray - Code Kadane's O(n) O(1)
16 Odd Even Linked List - Code Linked List O(n) O(1)
17 Find all anagrams in string - Code Frequency Array + Sliding Window O(n) O(1)
18 Permutation in String - Code Frequency Array + Sliding Window O(n) O(1)
19 Online Stock Span - Code Stack O(n) O(n)
20 Kth Smallest Element in a BST - Code O(n) O(n)
21 Count Square Submatrices with All Ones - Code DP Paradigm O(n^2) O(1)
22 Sort Characters By Frequency - Code Frequency Array Array O(n) O(1)
23 Interval List Intersections - Code O(n) O(1)
24 Construct Binary Search Tree from Preorder Traversal - Code Stack O(n) O(n)
25 Uncrossed Lines - Code DP Paradigm O(nm) O(nm)
26 Contiguous Array - Code Prefix Sum O(n) O(n)
27 Possible Bipartition - Code BFS O(V+E) O(V+E)
28 Counting Bits - Code O(n) O(n)
29 Course Schedule - Code Loop Detection + DFS/BFS Stack/Queue O(E+V) O(E+V)
30 K Closest Points to Origin - Code O(nlogn) O(n)
31 Edit Distance - Code DP Paradigm O(nm) O(nm)

About

Contains all my submissions for the 31 Day - LeetCode May'20 coding challenge

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages