
#Full Stack Development | MERN | NextJs | Typescript | Python | OpenAI | BuildInPublic | Open Source | #100DaysOfCode
Joined January 2023
- Tweets2.3K
- Following270
- Followers517
- Likes6.7K
DevVortex retweeted
You don't need to know everything to be a developer.
You need just enough knowledge to ask the right questions and make meaningful progress.
π #LeetCode POTD (Day 74) β
π‘ Approach (Bit Manipulation) :
1οΈβ£ In a circular XOR, original[0] repeats twice, so XOR of all derived must be 0.
2οΈβ£ Compute XOR of all derived elements.
3οΈβ£ Return true if XOR == 0, else false.
2
74
π #LeetCode POTD (Day 73) β
π‘ Approach (Bit Manipulation)
1οΈβ£ Elements with even frequency cancel out: x ^ x = 0
2οΈβ£ If nums1.size() is odd, XOR all elements of nums2.
3οΈβ£ If nums2.size() is odd, XOR all elements of nums1.
4οΈβ£ Return the final XOR result.
2
51
π #LeetCode POTD (Day 72) β
π‘ Approach (Bit Manipulation)
1οΈβ£ Count set bits in num1 & num2 using __builtin_popcount().
2οΈβ£ If num1 has fewer set bits, turn on unset bits from LSB.
3οΈβ£ If num1 has more set bits, turn off set bits from LSB.
2
68
π #LeetCode POTD (Day 66) β
Counting Words With a Given Prefix
π‘ Approach (String Matching)
1οΈβ£ Loop through the words, check if each starts with the prefix using starts_with().
2οΈβ£ Increment a counter for each match and return the total.
2
39
π #LeetCode POTD (Day 65) β
π‘ Approach (Brute Force)
1οΈβ£ For each word pair (i, j) where i < j, check if the first word is both a prefix and suffix of the second.
2οΈβ£ Use find and rfind to verify prefix-suffix match.
3οΈβ£ Count and return total valid pairs.
3
47
π #LeetCode POTD (Day 62) β
Shifting Letters II
π‘ Approach (Difference Array Pattern)
1οΈβ£ Build difference array for range shifts.
2οΈβ£ Compute cumulative shifts with prefix sum.
3οΈβ£ Apply mod 26 to handle shifts (negative/large), wrapping 'a' to 'z' accordingly.
6
66
π #LeetCode POTD (Day 61) β
π‘ Approach (Set + Two Pointers)
1οΈβ£ Identify first & last occurrence of each character.
2οΈβ£ Collect unique middle characters for valid ranges.
3οΈβ£ Return the count of unique palindromic subsequences.
2
33
π #LeetCode POTD (Day 59) β
Count Vowel Strings in Ranges
π‘ Approach (Prefix Sum)
1οΈβ£ Count words starting & ending with vowels, storing cumulative counts
2οΈβ£ For each query, use pf_sum[r] - pf_sum[l-1] formula
3οΈβ£ Store results for all queries
1
49
π #LeetCode POTD (Day 56) β
π‘ Approach (Dynamic Programming)
1οΈβ£ Start recursion with curr_len = 0, check bounds [low, high], set addOne = true if valid
2οΈβ£ Count ways via recursive calls for take_one & take_zero
3οΈβ£ Return addOne + take_one + take_zero (total ways)
2
68
π #LeetCode POTD (Day 55) β
π‘ Approach (Dynamic Programming)
1οΈβ£ Precompute freq for char counts at each column in words
2οΈβ£ Use recursion + memoization to find ways to form target[i] starting from column j
3οΈβ£ Either skip or use column j, ensuring results are modulo 1e9 + 7
1
3
61
π #LeetCode POTD (Day 52) β
Target Sum
π‘ Approach (DP)
1οΈβ£ Use recursion with memoization to explore adding/subtracting nums[ind].
2οΈβ£ Handle negatives by offsetting currSum with S = sum(nums).
3οΈβ£ Store results in dp[ind][currSum + S] to avoid recomputation and optimize.
1
1
57
π #LeetCode POTD (Day 51) β
Find Largest Value in Each Tree Row
π‘ Approach (Simple BFS)
1οΈβ£ Apply plain BFS to traverse the tree level by level.
2οΈβ£ At each level, store the maximum value in the result vector.
4
59
π #LeetCode POTD (Day 50) β
Find Minimum Diameter After Merging Two Trees
π‘ Approach (BFS)
1οΈβ£ Compute diameters (d1, d2) of both trees using BFS.
2οΈβ£ Merged diameter: max(d1, d2, βd1/2β + βd2/2β + 1).
3οΈβ£ BFS twice finds the farthest nodes to calculate tree diameter.
3
69
π #LeetCode POTD (Day 47) β
Maximum Number of K-Divisible Components
π‘ Approach (DFS)
1οΈβ£ Perform a DFS traversal to compute subtree sums.
2οΈβ£ If a subtree sum is divisible by k, it forms a valid component.
3οΈβ£ Increment component count (ans) and reset sum for that subtree.
3
64
π #LeetCode POTD (Day 45) β
Max Chunks To Make Sorted
π‘ Approach
1οΈβ£ Track curr_max while iterating.
2οΈβ£ If curr_max == i, itβs a valid chunk end.
3οΈβ£ Increment chunk count and return total.
3
72
π #LeetCode POTD (Day 43) β
Construct String With Repeat Limit
π‘ Approach (Heap)
1οΈβ£ Count character frequencies
2οΈβ£ Use a max-heap to pick the largest char
3οΈβ£ Append up to repeatLimit times
4οΈβ£ If chars remain, use the next largest char, then push back unused chars
3
35




















