← All tags

#Programming

14 uses
Posts
Post Mrinal

Today I solved Letter Combinations of a Phone Number using JavaScript and a classic Backtracking approach.

The problem is simple to understand but great for practicing recursion. Each digit from 2 to 9 represents a set of letters, similar to the keys on a traditional phone keypad. For example, 2 maps to abc and 3 maps to def. For the input "23", the expected combinations are: ["ad","ae","af","bd","be","bf","cd","ce","cf"] 💡 Approach I first created a phoneMap object to store the letter mapping for eac…

8
Post Mrinal

Another LeetCode problem solved and accepted! ✅

Today I worked on the Valid Parentheses problem, a classic problem that tests stack-based problem-solving and logical thinking. The goal is simple: determine whether a string containing (), {}, and [] is valid. A string is valid when every opening bracket has the correct closing bracket, and the brackets are properly nested. I solved this using a Stack in JavaScript. Whenever an opening bracket a…

8
Post Mrinal

Solved another LeetCode problem: Longest Common Prefix 🚀

Today’s challenge was to find the longest common prefix shared by all strings in an array. I implemented the solution in JavaScript and successfully passed all 126 test cases. The approach is straightforward and easy to understand. I started with the first string as the reference and compared each of its characters with the corresponding character in every other string. If a character does not ma…

8
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

Merge Two Sorted Lists — Solved in JavaScript

Today I solved LeetCode 21: Merge Two Sorted Lists, a classic linked-list problem that is great for strengthening pointer manipulation and understanding how linked lists work. The goal is simple: given two sorted linked lists, merge them into a single sorted linked list. For example: Input: List 1: [1,2,4] List 2: [1,3,4] Output: [1,1,2,3,4,4] I solved this using a dummy node and a current pointe…

7
Post Mrinal

Successfully solved the Integer to Roman problem in JavaScript and got an Accepted result with all 3999/3999 test cases passed! 🎉

The approach uses a greedy algorithm with Roman numeral values arranged from largest to smallest, including special combinations such as: 1000 → M 900 → CM 500 → D 400 → CD 100 → C 90 → XC 50 → L 40 → XL 10 → X 9 → IX 5 → V 4 → IV 1 → I The algorithm repeatedly checks whether the current number is greater than or equal to a Roman numeral value. If it is, that symbol is added to the result and the…

8
1
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 numer…

5

AI Is Moving Beyond Chatbots: Are We Entering the Age of Self-Improving AI?

A few years ago, artificial intelligence was mostly something people talked about in research labs, technology conferences and science fiction movies. Then chatbots changed everything. Suddenly, millions of people were using AI to write emails, create images, explain difficult subjects, write code, translate languages and answer everyday questions.But something else has been happening quietly in …

8
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
MCQs