Software Engineer | Cybersecurity Enthusiast | Backend Engineering Specialist | Passionate about DSA, OOP, Java, Spring Boot, AWS, React, and more 🚀 |

Joined December 2023
252 Photos and videos
Pinned Tweet
Don’t stress when it feels like everyone around you is earning money or moving ahead. We all have our own journey, and nothing great happens overnight. Stay focused, keep going, and don’t let laziness hold you back. Think about giving your family the life they deserve. Remember the sacrifices and hard work they’ve put in for you. For their happiness, work so hard that all the competition fades away. Spread love, peace, and positivity. Every small step forward counts.🙂
1
5
326
Leetcode POTD 2966(Medium) : Divide Array Into Arrays With Max Difference Approach Summary: The solution first sorts the input array, then iterates through it in steps of 3, checking the condition for the difference between the maximum and minimum elements. If the condition is met, it forms a subarray and stores it in a 2D array called result. If any subarray violates the condition, the method returns an empty 2D array. Finally, the method returns the resulting 2D array containing valid subarrays or an empty array if no valid subarrays are found. #Letsconnect #coder #DeveloperLife #developer #Coding #code #LearnInPublic #learninginpublic #100DaysOfCode
1
37
"Leetcode POTD 3405(Hard) : Count the Number of Arrays with K matching Adjacent Elements" Approach Summary: We precompute factorials and their modular inverses using Fermat's Little Theorem to efficiently calculate combinations. The total number of good arrays is determined by choosing k adjacent equal positions using n-1Ck, multiplying by m options for the first element, and then (m - 1)^(n - k - 1) for the remaining positions. Binary exponentiation is used for efficient power calculation. #letsconnect #developer #100DaysOfCode #LearnInPublic #Coding #codingcommunity
1
18
GitHub is down. Guess it’s time for a coffee break ☕️ #GitHubDown
1
113
Leetcode POTD 2016(Easy) : Maximum Difference Between Increasing Elements Approach Summary: The approach iterates through the array while keeping track of the minimum element seen so far. For each element, it calculates the difference with the minimum and updates the maximum difference if the current element is greater. This ensures the difference is only considered between a later and an earlier element. #letsconnect #learning #LearnInPublic #code #LearnAndGrow #Coding #100DaysOfCode
1
23
"Leetcode POTD 1432(Medium) : Max Difference You Can Get From Changing an Integer" Approach Summary: The idea is to maximize and minimize the given number by replacing digits. To maximize, we replace the first non-9 digit with 9 across the number. To minimize, we replace the first eligible digit with either 1 (for the first digit) or 0 (for others), avoiding leading zeros. The difference between the modified max and min values gives the result. #letsconnect #CONNECT #100DaysOfCode #CodingJourney #Java
1
19
"Leetcode POTD 440(Hard) : K-th Smallest in Lexicographical Order" Approach Summary: The approach visualizes numbers from 1 to n in lexicographical order as a prefix tree (Trie). Starting with prefix 1, it calculates how many numbers lie under the current prefix using the Count function. If the count is less than or equal to k, it moves to the next sibling (prefix 1); otherwise, it dives deeper by appending a 0 (curr × 10), simulating traversal into the child node. This helps efficiently locate the k-th number without generating the full list. #LearnInPublic #100daysofcoding #Coding #developerslife #SoftwareEngineer #letsconnect
1
24
"Leetcode POTD 1061(Medium) : Lexicographically Smallest Equivalent String" Approach : This approach builds a graph connecting equivalent characters from s1 and s2. For each character in baseStr, it uses DFS to explore all connected characters and finds the lexicographically smallest one in its connected component. This smallest character is then used to form the resulting string. #learnandgrow #LearningJourney #100DaysOfCode #100daysofcoding #Growth
1
26
"Leetcode POTD 3355(Medium) : Zero Array Transformation I " Approach Summary: Approach 1 (Simple Simulation): This approach applies each query one by one on the array and once all queries are done , we check in the last if the input array has become all zero or not. Approach 2 (Binary Search on Queries using Difference Array): The problem uses a range update optimization with a difference array to efficiently track the number of operations applied across subarrays. Each query adds a 1 increment over a given range, and we build a diff array to record these in constant time per query. We then compute the cumulative sum to find how many operations affect each index. Finally, we check if the number of applied operations is sufficient to reduce each nums[i] to zero. If any element needs more operations than available, we return false. #letsconnect #learning #LearnInPublic #LearnToCode #100daysofcoding #100DaysOfCode #coding
1
15
"Leetcode POTD 3024(easy) : Type of Triangle" Approach Summary: Triangle Validity Check: Before classifying the triangle, it checks if the three sides can form a valid triangle using the triangle inequality theorem: For any triangle, the sum of the lengths of any two sides must be greater than the third side. If this condition fails, it returns "none" as the sides can't form a triangle. Triangle Type Classification: If the triangle is valid, it checks the equality of the sides: - If all three sides are equal, it's an equilateral triangle. - If all three sides are different, it's a scalene triangle. - If exactly two sides are equal, it's an isosceles triangle. #LetsConnect #CONNECT #Connection #learning #LearnInPublic #CodingJourney #buildinginpublic
1
16
"Leetcode POTD 1931(Hard) : Painting a grid with three different colors" Approach Summary: The intuition behind this problem lies in breaking down a 2D grid coloring task into column-by-column choices, ensuring that colors follow rules: no two adjacent cells (vertically or horizontally) have the same color. Instead of coloring the whole grid directly, we precompute valid column patterns and use dynamic programming to count how many ways columns can be placed side by side without breaking the rules. This approach reduces complexity by reusing results and treating each column as a state. #CONNECT #Connections #letsconnect #100DaysOfCode #coding #LearnInPublic
1
29
Easy Peasy🤟
4
"Leetcode POTD 2901(Medium) : Longest Unequal Adjacent Group Subsequence II " Approach Summary: This problem is solved using a variant of Longest Increasing Subsequence (LIS). We treat each word as a potential end of a valid subsequence and use DP (dp[i]) to store the length of the longest valid chain ending at index i. For each pair of words (j, i), we check if the groups are unequal, word lengths match, and the Hamming distance is exactly 1 — if so, we try extending the subsequence. A parent[] array helps reconstruct the actual sequence at the end. #Connect #letsconnect #DSA #100DaysOfCode #LearnInPublic #LearnToCode
1
24
"Leetcode POTD 3335(Medium) : Total Characters in String After Transformation I" Approach Summary: The intuition behind the solution is to simulate t rounds of character transformations based on defined rules: each character shifts forward in the alphabet, and 'z' splits into 'a' and 'b'. A frequency array tracks how many of each character exist after each round. This avoids working with actual strings, making the approach efficient. The final result is the sum of all character frequencies after t transformations, computed modulo 109 7. #Connect #LetsConnect #Learning #learnwithme #learningisfun #LearnInPublic #developers #DeveloperLife
1
21
"Leetcode POTD 1550(Easy) : Three Consecutive Odds" Approach Summary: Approach 1 (Window of 3 Elements): This method iterates through the array using a sliding window of size 3. At each step, it checks whether the current element and the next two are all odd numbers. If such a triplet is found, it returns true; otherwise, it continues until the end of the array. It's simple and efficient for this specific check. Approach 2 (Counting Consecutive Odds): This method maintains a counter to track the number of consecutive odd numbers. It increments the counter for each odd number found, and resets it when an even number is encountered. If the counter reaches 3 at any point, it returns true. This approach is slightly more flexible and generalizable. #CONNECT #LearnInPublic #LearningTweet #CodeNewbies #CodingChallenge #codingexperts
1
45
"Leetcode POTD 2918(Medium) : Minimum Sum Equal of Two Arrays After Replacing Zeroes" Approach Summary: The approach focuses on minimizing the total sum of two arrays by replacing each zero with the smallest possible positive integer, which is 1. It then calculates the adjusted sums of both arrays. If one array's sum is still smaller and has no zeros left to adjust, it's impossible to make the sums equal—hence, return -1. Otherwise, the maximum of the two adjusted sums is the minimum equal sum achievable. This ensures the most efficient use of zero replacements. #CONNECT #letsconnect #learntocode #LearnInPublic #100DaysOfCode #SoftwareEngineering
1
29
"Leetcode POTD 3343(Hard) : Count Number of Balanced Permutations" Approach Summary: The core idea behind the solution is to count permutations where the sum of digits at even indices equals the sum at odd indices. Brute-force checks all permutations, but it's inefficient for large inputs. The optimized approach uses digit frequency counting and combinatorics to avoid generating all permutations explicitly. It recursively assigns digits to even and odd positions, tracking the running sums and ensuring balance. To handle duplicate digits and large numbers, it uses modular arithmetic, factorials, and Fermat's Little Theorem for inverse factorials. Memoization avoids redundant calculations for repeated states. #CONNECTION #CONNECT #LearnToCode #LearnInPublic #learninginpublic
1
28
"Leetcode POTD 3341(Medium) : Find Minimum Timen to Reach Last Room I" Approach Summary: The approach uses Dijkstra's algorithm to find the minimum time required to reach the bottom-right cell from the top-left cell in a grid. Each cell has a specific time constraint, and the traveler must wait if they arrive too early. The algorithm maintains a priority queue to always process the cell with the least arrival time first. At each step, it explores neighboring cells, calculates the earliest possible arrival time considering the wait, and updates the result if a faster path is found. This ensures the shortest time path is calculated efficiently. #CONNECT #letsconnect #LearnInPublic #LearnToCode #100daysofcoding #CodingChallenge
1
11
"Leetcode 2528(Hard) : Merge Operations for Minimum Travel Time" Approach Summary: The approach uses top-down dynamic programming with memoization to minimize travel time across n positions, considering up to k merge operations. At each step, we can either skip to the next node or merge multiple subsequent nodes, adjusting the travel rate accordingly. The recursive solve function explores all valid combinations, storing intermediate results in a 3D DP array to avoid redundant calculations. The goal is to find the minimum total time from the start to the end while using at most k merges. #learning #LearnToCode #learningsupport #LearningJourney #100DaysOfCode #100daysofcoding
1
9
"Leetcode POTD 1007(Medium) : Minimum Domino Rotations For Equal Row" Approach Summary: The problem is to make all values in either the top or bottom row of dominoes equal using the minimum number of swaps. Since each domino has values from 1 to 6, we try each possible value (1 to 6) and check if it's possible to make all elements in one row equal to that value. For each candidate value, we count how many swaps are needed to align either the top or bottom row. Among all valid values, we return the minimum number of swaps needed. #LearnToCode #LearnAndGrow #CodingJourney #100DaysOfCode #100daysofcoding #LearnInPublic
1
22
"leetcode POTD 2071 (Hard) : maximum Number of Tasks You can Assign" Approach Summary: The goal is to assign as many tasks as possible by matching the hardest tasks with the strongest available workers. If a worker isn’t strong enough for a task, we check if giving them a limited-use strength boost (a pill) makes the assignment possible. We test whether a certain number of tasks can be completed by simulating assignments from hardest to easiest. Binary search helps efficiently find the maximum feasible number of tasks that can be completed under these constraints. #CONNECTION #CONNECT #learning #LearnInPublic #100DaysOfCode #CodingJourney
1
31