Gaurav
@gauravmawari18
Followers
11
Following
264
Media
256
Statuses
272
๐ Day 256/โ ๐ Solved First Bad Version ๐๐ ๐ก Applied binary search to minimize API calls and locate the first bad version efficiently. Time Complexity: O(log n) | Space: O(1) ๐ช #LeetCode #DSA #BinarySearch #CodeEveryday #KeepCoding #100DaysOfCode
0
0
0
๐ Day 255/โ ๐ Solved Missing Number ๐ขโ ๐ก Used the sum formula to find the missing value in linear time. Clean math solution! Time Complexity: O(n) | Space: O(1) ๐ช #LeetCode #DSA #Math #BitManipulation #CodeEveryday #KeepCoding #100DaysOfCode
0
0
1
๐ Day 254/โ ๐ Solved Nim Game ๐ฎ๐ง ๐ก Observed the pattern โ if n % 4 == 0, the first player loses; otherwise, they win. Classic game theory insight! Time Complexity: O(1) | Space: O(1) ๐ช #LeetCode #DSA #GameTheory #Math #CodeEveryday #KeepCoding #100DaysOfCode
0
0
1
๐ Day 253/โ ๐ Solved Ugly Number ๐ข ๐ก Repeatedly divided the number by 2, 3, and 5 to check if it reduces to 1. Simple math-based validation! Time Complexity: O(log n) | Space: O(1) ๐ช #LeetCode #DSA #Math #CodeEveryday #KeepCoding #100DaysOfCode
0
0
1
๐ Day 252/โ ๐ Solved Reverse Integer ๐ข๐ ๐ก Reversed digits mathematically while carefully handling 32-bit integer overflow. Time Complexity: O(log n) | Space: O(1) ๐ช #LeetCode #DSA #Math #CodeEveryday #KeepCoding #100DaysOfCode
0
0
1
๐ Day 251/โ ๐ Solved String Compression ๐งตโ๏ธ ๐ก Used two pointers to compress the string in-place by counting consecutive characters. Time Complexity: O(n) | Space: O(1) ๐ช #LeetCode #DSA #TwoPointers #String #CodeEveryday #KeepCoding #100DaysOfCode
0
0
1
๐ Day 250/โ ๐ Solved Happy Number ๐๐ข ๐ก Used Floydโs Cycle Detection to identify loops while repeatedly replacing the number with the sum of squares of its digits. TC: O(log n) | Space: O(1) ๐ช #LeetCode #DSA #Math #TwoPointers #CodeEveryday #KeepCoding #100DaysOfCode
0
0
1
๐ Day 249/โ ๐ Solved String to Integer (atoi) ๐คโก๏ธ๐ข ๐ก Carefully parsed the string, handled leading spaces, optional sign, digits, and overflow conditions. Edge cases make this one tricky but fun! TC: O(n) | SC: O(1) ๐ช #LeetCode #DSA #CodeEveryday #KeepCoding #100DaysOfCode
0
0
1
๐ Day 248/โ ๐ Solved Palindrome Number ๐ข๐ ๐ก Reversed half of the number and compared โ no string conversions needed! Time Complexity: O(log n) | Space: O(1) ๐ช #LeetCode #DSA #Math #CodeEveryday #KeepCoding #100DaysOfCode
0
0
1
๐ Day 247/โ ๐ Solved Score of a String ๐คโก ๐ก Calculated the score by summing absolute differences between adjacent characters โ simple logic, clean implementation! Time Complexity: O(n) | Space: O(1) ๐ช #LeetCode #DSA #String #CodeEveryday #KeepCoding #100DaysOfCode
1
0
3
๐ Day 246/โ ๐ Solved Sort Colors ๐จโช๐ด๐ต ๐ก Implemented the Dutch National Flag Algorithm โ three pointers to sort 0s, 1s, and 2s in a single pass. Time Complexity: O(n) | Space: O(1) โก #LeetCode #DSA #TwoPointers #Greedy #CodeEveryday #KeepCoding #100DaysOfCode
1
0
4
๐ Day 245/โ ๐ Solved Rearrange Array Elements by Sign โโ ๐ก Reordered elements by alternating positive and negative values while keeping their original relative order โ clean and intuitive! TC: O(n) | Space: O(n) โก #LeetCode #DSA #TwoPointers #CodeEveryday #KeepCoding
0
0
2
๐ Day 244/โ ๐ Solved Single Number ๐ ๐ก Used bitwise XOR to cancel pairs and find the unique element in a single pass. Time Complexity: O(n) | Space: O(1) โก #LeetCode #DSA #BitManipulation #CodeEveryday #KeepCoding #100DaysOfCode
1
0
4
๐ Day 243/โ ๐ Solved Generate Parentheses ๐๐งฉ ๐ก Used backtracking (build sequences, prune when opens < closes) to generate all valid combinations. TC: O(Cn ยท n) (Catalan-number growth) | Space: O(n) for recursion. ๐ช #LeetCode #DSA #Backtracking #CodeEveryday #KeepCoding
0
0
1
Solved Count Collisions on a Road ๐๐ฅ๐ ๐ก Trimmed leading Lโs and trailing Rโs, then counted all remaining non-static cars โ a neat observation-based solution! Time Complexity: O(n) | Space: O(1) โก #LeetCode #DSA #Greedy #CodeEveryday #KeepCoding #100DaysOfCode
0
0
1
๐ Day 241/โ ๐ Solved Count Partitions with Even Sum Difference โ๐ข ๐ก Calculated total sum and counted how many prefix sums split the array so that the difference of the two parts is even. TC: O(n) | Space: O(1) โก #LeetCode #DSA #CodeEveryday #KeepCoding #100DaysOfCode
0
0
1
๐ Day 240/โ ๐ Solved Spiral Matrix ๐๐ ๐ก Simulated the spiral traversal using four boundaries โ top, bottom, left, right โ and moved layer by layer. Time Complexity: O(mยทn) | Space: O(1) ๐ #LeetCode #DSA #Matrix #Simulation #CodeEveryday #KeepCoding #100DaysOfCode
0
0
2
๐ Day 239/โ ๐ Solved Contains Duplicate ๐ ๐ก Simple and efficient โ used a HashSet to detect duplicates in linear time. Time Complexity: O(n) | Space: O(n) โก #LeetCode #DSA #Hashing #CodeEveryday #KeepCoding #100DaysOfCode
0
0
2
๐ Day 237/โ ๐ Solved Contains Duplicate II ๐๐ ๐ก Used a sliding window + HashSet to check if the same value appears within the index distance k. Efficient and clean approach! TC: O(n) | Space: O(k) โก #LeetCode #DSA #Hashing #SlidingWindow #CodeEveryday #KeepCoding
0
0
1