Skip to content

Ashi-s/daily_coding

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

273 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

I challenged myself to solve a coding problem daily, it can either be a newsletter problem sent by daily coding challenge everyday, Leetcode monthly challenge or previously asked questions by big tech.

Daily Coding Problems

# Company Description Solution
31 Google distance beween two string solution
33 Microsoft running median of a sequence solution
35 Google strict RGB sequence solution
37 Google Power set solution
38 Microsoft N queen solution
41 Facebook flight iternary solution
42 Google subset add to target solution
47 Amazon Buy Stock 1 solution
49 Amazon Maximum Subarray solution
50 Microsoft Evaluate expression in Binary tree solution
51 Facebook Generates perfectly random solution
53 Apple Implement Queue using two stacks solution
54 DropBox Sudoku solution
58 Amazon Find Minimum in Rotated Sorted Array solution
60 Facebook Parition two subset solution
61 Google Pow(x, n) solution
62 Facebook Way to Reach Bottom matrix solution
63 Microsoft find word in matrix solution
74 Apple Number of times Element appears solution
75 Microsoft Longest Increasing Subsequence solution
76 Google Delete column to make it sorted solution
77 SnapChat Merge Intervals solution
78 Facebook Non Decreasing Array solution
81 Yelp Phone Number Combination solution
86 Google Minimum parenthesis remove to make it valid solution
88 ContextLogic Implement division without using division, multiplication or Modulus solution
89 LinkedIn Valid BST solution
90 Google Generate random number excluding he lsit solution
91 DropBox Dry run code snippet solution
96 Microsoft Subsets solution
98 Courseera Word Search solution
99 Microsoft Longest Consecutive Sequence solution
100 Google Minimum steps to cover an infinite grid solution
101 Alibaba Return two primes who's sum equals the number solution
108 Google Rotate String solution
109 Cisco Swap Odd Even bits solution
113 Google Reverse word in a String solution
115 Google Subtree of Another Tree solution
122 Zillow Matrix max coins solution
125 Google Two Sum IV - Input is a BST solution
126 Facebook Rotate Arrays solution
146 Facebook Binary Tree Pruning solution

Dynamic Programming / Recursion / Back Tracking

# Description Solution
1 Airthmetic slices solution
2 Buy Stock 1 solution
3 Coin change solution
4 Coin change 2 solution
5 Combination Sum solution
6 Combination Sum 2 solution
7 Combinations solution
8 Factorial solution
9 Fibonnaci solution
10 Flood fill solution
11 Frog Jump solution
12 Generate all substrings solution
13 Generate all Parenthesis solution
14 Subsets solution
15 Letter Combinations of a Phone Number solution
16 Longest Palindromic Substring solution
17 Making A Large Island solution
18 Maximal Square solution
19 First Missing Positive solution
20 Minimum Falling Path Sum solution
21 Minimum Path Sum solution
22 Number of Longest Increasing Subsequence solution
23 Paint House solution
24 House Robber solution
24 Pow(x, n) solution
25 Subsets II solution
26 Triangle solution
27 N Queen II solution
28 Expression and Operator solution
29 Shortest path grid solution
30 Shortest path grid with obstacles solution
31 Jump Game solution
32 Word Search solution
33 Word Search II solution
34 Maximum length Subarray with positive product solution
35 Best Time to Buy & Sell Stock with Cooldown solution
36 Buy & Sell Stock III solution
37 Path Sum III solution
38 3 Sum solution
39 Rotting Tomatoes solution
40 Different ways to Add Parenthesis solution
41 Unique Paths III solution
42 Iterator for Combinations solution
43 Largest Divisible Subset solution
44 Unique Paths solution
45 Jump Game III solution
46 Domino and Tromino Tiling solution
47 Numbers At Most N Given Digit Set solution
48 Palindrome Partitioning solution
49 Cherry Pickup solution
50 Jump Game IV solution
51 Stone Game IV solution
52 Predict the winner solution
53 Word Ladder solution
54 Remove k digits solution
55 Encrypted Words solution
56 Change In Foreign Currency solution
57 Minimum Operations solution
58 Max Length Chain solution
59 Longest Common Subsequence solution
60 Longest Common Substring solution
61 Jump Game II solution
62 Number of Dice Rolls With Target Sum solution
63 Merge Sort solution
64 Word Break solution
65 Minimum Domino Rotations For Equal Row solution
66 Smallest String With A Given Numeric Value solution

Trees

# Description Solution
1 Two Sum IV - Input is a BST solution
2 BFS & DFS solution
3 Binary Tree from List solution
4 Binary Search Tree solution
5 BST from List solution
6 Binary Tree Average Level solution
7 Connected components undirected graph solution
8 Count good node solution
9 Evaluate expression binary tree solution
10 Left & Right View Tree solution
11 Maximum product of splitted binary tree solution
12 N-ary tree level traversal solution
13 Number of islands solution
14 Path Sum II solution
15 Path Sum solution
16 Redundant connection cycle in graph solution
17 Smallest subtree with all deepest node solution
18 Verify Preorder Serialization of a Binary Tree solution
19 Same Tree solution
20 Diameter of Binary Tree solution
21 Construct a BST from preorder traversal solution
22 Cousin in Binary Tree solution
23 Binary Tree Paths solution
24 Count complete Tree Nodes solution
25 Invert Binary Tree solution
26 Subtree of Another Tree solution
27 Maximum Level Sum of a Binary Tree solution
28 Sum Root to Leaf Numbers solution
29 Sum of Left Leafs solution
30 Unique BST solution
31 Construct Binary Tree from Inorder and Postorder Traversal solution
32 Delete node ina BST solution
33 Binary Tree Pruning solution
34 Binary Tree Tilt solution
35 Range Sum of BST solution
36 Populating Next Right Pointers in Each Node solution
37 Maximum Difference Between Node and Ancestor solution
38 Sum of Root To Leaf Binary Numbers solution
39 Insert into a Binary Search Tree solution
40 All Elements in Two Binary Search Trees solution
41 Node in Subtree solution
42 Maximum width of Binary Tree solution
43 Bottom View of BT solution
44 Vertical Traversal BT solution
45 Find Bottom Left Tree Value solution
46 Lowest Common Ancestor of a Binary Tree solution
47 Binary Tree Maximum Path Sum solution
48 Validate Binary Search Tree solution
49 Lowest Common Ancestor of a Binary Search Tree solution
50 Search in a Binary Search Tree solution
51 Trim a Binary Search Tree solution
52 Convert BST to Greater Tree solution
53 Increasing Order Search Tre solution
54 Kth Smallest Element in a BST solution
55 Recover Binary Search Tree solution
56 Binary Search Tree Iterator solution

Arrays

# Description Solution
1 Complex Number Multiplication solution
2 Sum of squares number solution
3 3 Sum solution
4 Add string solution
5 first And Last Element SortedArray solution
6 Array of doubled pairs solution
7 Search in Rotated Sorted Array solution
8 Range Addition II solution
9 Find Minimum in Rotated Sorted Array solution
10 Array Nesting solution
11 Orderly Queue solution
12 Count special quadruples solution
13 Slowest key solution
14 Shifting Letters solution
15 Max Multiply three numbers solution
16 Perfect Number solution
17 Merge Sorted Array solution
18 Reverse only Letters solution
19 Longest Turbulent Subarray solution
20 Spiral Matrix solution
21 Delete column to make it sorted solution
22 Merge Intervals solution
23 Intersection Two Arrays II solution
24 Remove duplicates sorted array solution
25 Valid Tic Tac Toe solution
26 Valid Tic Tac Toe solution
27 Maximum Length of a Concatenated String with Unique Characters solution
28 Break a palindrome solution
28 Tribonnacci Number solution
29 Unique Email Address solution
30 Sort Array Parity II solution
31 Island Perimeter solution
32 Find All Duplicates in Array solution
33 Longest Consecutive Sequence solution
34 Count Primes solution
35 Minimum steps to cover an infinite grid solution
36 Return two primes who's sum equals the number solution
37 Subarray sum equal to k solution
38 Richest customer wealth solution
39 Next Greater Element I solution
40 Reverse word in a String solution
41 Insert Delete Get Random (1) solution
42 Shortest Subarray to be Removed to Make Array Sorted solution
43 Sort Colors solution
44 Arranging Coins solution
45 Multiply Strings solution
46 Generate Pi value using random number between 0 & 1 solution
47 Best Time to Buy and Sell Stock II solution
48 Minimum Value to Get Positive Step by Step Sum solution
49 Daily temperatures solution
50 Kth Smallest Number in Multiplication Table solution
51 Find All Numbers Disappeared in an Array solution
52 Hamming Distance solution
53 Single Element in a Sorted Array solution
54 Interval List Intersections solution
55 Accounts Merge solution
56 Largest Rectangle in Histogram solution
57 Maximum Product Subarray solution
58 Remove Duplicate Letters solution
59 Minimum Cost to Move Chips to The Same Position solution
60 Partition Equal Subset Sum solution
61 Consecutive Characters solution
62 Minimum Absolute Difference solution
63 Power of Two solution
64 Remove Covered Intervals solution
65 K Closest Point to Origin solution
66 Number Complement solution
67 Best Sightseeing Pair solution
68 Smallest Integer Divisible by K solution
69 Pairs of Songs With Total Durations Divisible by 60 solution
70 Find the Town Judge solution
71 Car Pooling solution
72 Robot Bounded In Circle solution
73 Minimum Number of Arrows to Burst Balloons solution
74 String to Integer (atoi) solution
75 Maximize Distance to Closest Person solution
76 Word pattern solution
77 Can Place Flowers solution
78 Gas Stations solution
79 Sequential Digits solution
80 Detect Capital solution
81 Valid Mountain Array solution
82 Find All Anagrams in a String solution
83 4 Sum II solution
84 Contiguous Array solution
85 Remove Duplicates from Sorted Array II solution
86 Find the Difference solution
87 Add Digits solution
88 K-diff Pairs in an Array solution
89 Permutation in Strings solution
90 Continuous Subarray Sum solution
91 Subarray Sums Divisible by K solution
92 Minimum Size Subarray Sum solution
93 Minimum Operations to Reduce X to Zero solution
94 K Radius Subarray Averages solution
95 Robot Return to Origin solution
96 Make Two Arrays Equal by Reversing Sub-arrays solution
97 Contiguous Subarray solution
98 Rotational Cipher solution
99 Minimize Deviation in Array solution
100 Minimize Permutation solution
101 Minimum swaps to sort array solution
102 Slow Sums solution
103 Element Swapping solution
104 Seating Arrangements solution
105 Revenue Milestones solution
106 Billion Users solution
107 Balanced Split solution
108 Counting Triangles solution
109 Excel Sheet Column Number solution
110 Total Cache Optimization solution
111 Compare Version Numbers solution
112 Summary ranges solution
113 Counting Bits solution
114 Largest Triplet Product solution
115 Is Subsequence solution
116 Matching Pairs solution
117 Champagne Tower solution
118 Earn and Delete solution
119 Count All Valid Pickup and Delivery Options solution
120 Merge without extra Space solution
121 Sort Array By Parity solution
122 Trapping Rain Water solution
123 Snapshot Array solution
124 Count Servers that Communicate solution
125 Find the Duplicate Number solution
126 Spiral matrix II solution
127 Diagonal Traverse solution
128 Simplify Paths solution
129 Minimum Remove to Make Valid Parentheses solution
130 English word to Integer solution
131 Integer To English Word solution
132 Score of Parenthesis solution
133 Partition Labels solution
134 Broken Calculator solution
135 Boats to Save People solution
136 Two City Scheduling solution
137 Container With Most Water solution
138 Rotate Image solution
139 The K Weakest Rows in a Matrix solution
140 Longest Repeating Character Replacement solution
141 Valid Anagram solution
142 Non-overlapping Intervals solution
143 Insert Intervals solution
144 Search in Rotated Sorted Array II solution
145 Search a Matrix 2D solution
146 Valid Palindrome II solution
147 Next Permutation solution
148 3Sum With Multiplicity solution
149 Last Stone Weight solution
150 Baseball Game solution
151 Game of Life solution
152 Encode and Decode TinyURL solution
153 Design Underground System solution
154 Peeking Iterator solution
155 Path With Minimum Effort solution
156 Backspace String Compare solution

Link List

# Description Solution
1 Reverse a Link List solution
2 Split Link List in Parts solution
3 Flatten a Multilevel Doubly Linked List solution
4 Swap Nodes in Pairs solution
5 Remove Linked List Elements solution
6 Odd Even Linked List solution
7 Convert Binary Number in a Linked List to Integer solution
8 Insertion Sort List solution
9 Reorder List solution
10 Middle of the Linked List solution
11 Linked List Random Node solution
12 Linked List Cycle solution
13 Linked List Cycle II solution
14 Add Two Numbers LL solution
15 Add Two Numbers II LL solution
16 Merge Two Sorted Lists solution
17 Merge k Sorted Lists solution
18 Maximum Sum Of First And last solution
19 Sort List solution
20 Remove Duplicates from Sorted List II solution
21 Rotate List solution
22 Copy List with Random Pointer solution
23 Swapping Nodes in a Linked List solution

Graph

# Description Solution
1 Largest Component Size by Common Factor solution
2 Connected components undirected graph solution
3 All Paths From Source to Target solution
4 Course Schedule II solution
5 Find whether path exists solution
6 Shortest Path In Binary Matrix solution
7 Redundant connection cycle in graph solution
8 Course Schedule solution
9 Is Graph Bipartite? solution

Stack and Queues

# Description Solution
1 Minimum parenthesis remove to make it valid solution
2 Min Stack solution
3 Decode String solution
4 First non-repeating character in a stream solution
5 Remove All Adjacent Duplicates in String II solution
6 Validate Stack Sequence solution
7 Maximum Frequency Stack solution
7 Shift 2D Grid solution

Heap

# Description Solution
1 Magical Candy Bag solution
2 Kth Largest Element in a Stream solution

Bit Manipulation

# Description Solution
1 Bitwise AND of Numbers Range solution
2 Add Binary solution

Binary Search

# Description Solution
1 Koko Eating Bananas solution
2 Search Insert Position solution
3 Search Rotated Array solution
4 Range Frequency Queries solution
5 Binary Search solution
6 Split Array Largest Sum solution

Trie

# Description Solution
1 Stream of Characters solution
1 Design Add and Search Words Data Structure solution

How to contribute

Feel free to send me a pull requests, if you spot issues with any of my solutions!

Happy Coding !!!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages