shlogg 路 Early preview
Rahul Kumar Barnwal @rahulgithub-web

Full-stack developer | Passionate about Problem Solving, Node.js, React, and Next.js | Tech mentor @ Polaris | Open Source Contributor | Sharing insights on coding, SaaS, and project building 馃殌

Word Pattern Match: True If S Follows Pattern.

Word Pattern" problem: Given a pattern string & a string s, return true if each char maps to exactly one word & vice versa. Use two hash maps to ensure consistency. Time complexity: O(n), space complexity: O(1).

Isomorphic Strings: Mapping Characters In S To T

Two strings s and t are isomorphic if each character in s can be replaced by a unique character in t, preserving order. Example: 'e' maps to 'a', 'g' maps to 'd'. JavaScript solution uses two hash maps to ensure consistent mapping.

Ransom Note Problem: Can Construct RansomNote From Magazine Letters

Can you construct ransomNote using letters from magazine? Count chars in magazine, then validate against ransomNote. Time complexity: O(n+m), space complexity: O(k). Example solutions in JavaScript.

Rotate Image In Place By 90 Degrees Clockwise

Rotate a matrix by 90 degrees clockwise in place. Transpose the matrix, then reverse each row. Example: [[1,2,3],[4,5,6],[7,8,9]] -> [[7,4,1],[8,5,2],[9,6,3]]. Time complexity: O(n^2), space complexity: O(1).

Spiral Matrix Traversal In O(m*n) Time Complexity

Solve LeetCode 54: Spiral Matrix by defining boundaries (top, bottom, left, right) that shrink as you traverse the matrix in spiral order. Time complexity is O(m鈰卬), space complexity is O(1).

Substring With Concatenation Of All Words

Solve substring with concatenation of all words using sliding window & hash map. Precompute word frequencies, slide window, shrink or expand based on matches. Time complexity: O(n鈰卥), space complexity: O(m+k).

Top Interview 150: Solving 3Sum With Sorting And Two-Pointer Technique

The 3Sum problem is a classic interview challenge that combines sorting, two-pointer techniques, and efficient duplicate handling to find all unique triplets in an integer array that sum up to zero.

Lessons From 2024: Resilience, Collaboration & Time Management

Lessons from 2024: Resilience is key, collaboration matters, time management crucial & community just as important as code. Mastering cloud-native dev, launching SaaS side project & shaping future with AI, serverless arch & Web3.

Reverse Words In A String With Optimized Solution

Reverse Words in a String": Optimize solution without split or trim. Traverse string, skip spaces, extract words & prepend to result. Handle single spaces between words. Time complexity: O(n), space complexity: O(n).

Top Interview 150: Minimize Candies With Greedy Algorithms

Solve LeetCode 135: Candy with a greedy algorithm. Assign 1 candy to each child, then traverse left-to-right and right-to-left to ensure higher-rated children get more candies.

Remove Duplicates From Sorted Array In O(n) Time

Remove duplicates from sorted array in-place: use two-pointer technique, initialize k=1, iterate through array & copy unique elements to nums[k], return k for count of unique elements.