Leetcode - 20. Valid Parentheses

ApproachWe loop through chars of s , if its a closing bracket we compare with last element in stack , it should be appropriate as define in map otherwise we return falseJavascript Code ⛶/** * @para...
0 Read More

Leetcode - 71. Simplify Path

Using Stack ⛶/** * @param {string} path * @return {string} */ var simplifyPath = function (path) { let myStack = []; for (char of path.split("/")) { if (char == "" || char == "...
0 Read More

Leetcode - 155. Min Stack

Implementing MinStack in JavaScript Problem Statement Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. Requirements: push(v...
0 Read More

Leetcode - 2. Add Two Numbers

Leetcode - 2. Add Two Numbers
Understanding Carry in Linked List Addition Key Concepts Numbers are stored in reverse order as linked lists. Each node contains a single digit. Carry is needed when sum > 9. Res...
0 Read More