All tags

#CodingJourney

8 uses
Posts
Post Mrinal

LeetCode Problem: Container With Most Water | JavaScript

This problem is an excellent example of how choosing the right algorithm can significantly improve performance and efficiency. 📌 Problem Overview: Given an array of non-negative integers representing the heights of vertical lines, the goal is to find two lines that, together with the x-axis, can hold the maximum amount of water. The challenge is to maximize the area between two lines while consid…

2
Post Mrinal

Today I solved LeetCode #20 – Valid Parentheses using JavaScript and successfully passed all 103 test cases! 🎯

The problem looks simple at first, but it is a great example of how choosing the right data structure can make a solution both clean and efficient. The goal is to determine whether a string containing (), {}, and [] is valid. Every opening bracket must have the correct closing bracket, and brackets must close in the proper order. I solved it using a Stack. The approach is straightforward: Create …

7
Post Mrinal

Another LeetCode Problem Solved! | Roman to Integer

Consistency is the key to becoming a better programmer, and today I’m excited to share another successful milestone in my coding journey! 🎯 I successfully solved the Roman to Integer problem on LeetCode using JavaScript, achieving an Accepted status with all 3999 test cases passed. 🔍 What I Learned: The problem focuses on converting Roman numerals into their corresponding integer values. Roman nu…

5
Post Mrinal

LeetCode Progress: Palindrome Number | JavaScript

Another problem solved and another step forward in my coding journey! 💻 Today, I successfully solved LeetCode Problem 9: Palindrome Number using JavaScript. The challenge was to determine whether a given integer reads the same forward and backward. For example: ✅ Input: 121 → Output: true ❌ Input: -121 → Output: false ❌ Input: 10 → Output: false 💡 My Approach I used a mathematical approach to rev…

4
Post Mrinal

Another coding problem successfully solved!

Today’s challenge was LeetCode – Zigzag Conversion, a great problem for practicing string manipulation, arrays, loops, and direction-based traversal in JavaScript. The problem gives us a string and a number of rows. We need to arrange the characters in a zigzag pattern and then read the characters row by row to generate the final string. For example: PAYPALISHIRING With numRows = 3, the character…

6
Post Mrinal

Today’s coding challenge was LeetCode – Longest Palindromic Substring.

The goal is simple but interesting: given a string s, find the longest substring that reads the same forward and backward. For example: Input: "babad" Output: "bab" or "aba" 💡 Approach: Expand Around Center Instead of generating every possible substring and checking whether it is a palindrome, I used the Expand Around Center technique. Every palindrome has a center: Odd-length palindrome → one ch…

6
Post Mrinal

Today’s coding practice focused on a classic LeetCode problem: Longest Substring Without Repeating Characters.

The goal is simple but requires a smart approach: given a string, find the length of the longest substring that contains no repeated characters. For example: "abcabcbb" → 3 ("abc") "bbbbb" → 1 ("b") "pwwkew" → 3 ("wke") Instead of checking every possible substring, I solved it using the Sliding Window + Hash Map technique. 💡 How the approach works I maintain two important variables: 🔹 start — rep…

6
Post Mrinal

Today, I successfully solved the “Add Two Numbers” problem on LeetCode using JavaScript.

The problem involves adding two numbers represented by linked lists, where each node contains a single digit. The digits are stored in reverse order, and the result must also be returned as a linked list. For example: Input: l1 = [2,4,3] l2 = [5,6,4] Output: [7,0,8] This problem may look simple at first, but it requires careful handling of several important concepts: 🔹 Linked List Traversal I lea…

7