LeetCode – Game of Life Problem | Solution with JavaScript Link – https://leetcode.com/problems/game-of-life/ Problem Statement – According to Wikipedia’s article: “The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John Horton Conway in 1970.” The board is made up of a m x n grid of cells, where each cell has […]

Read More →

LeetCode – Coin Change Problem Problem LeetCode Link – https://leetcode.com/problems/coin-change/ You are given an integer array coins representing coins of different denominations and an integer amount representing a total amount of money. Return the fewest number of coins that you need to make up that amount. If that amount of money cannot be made up by any combination of the […]

Read More →

Trapping Rain Water Leetcode This question is taken by LeetCode. You can find question detail by the below link. Let’s write an optimized solution to this problem. https://leetcode.com/problems/trapping-rain-water/ Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining. Example 1: Input: height = […]

Read More →

Backspace String Compare Leetcode LeetCode Question Link: https://leetcode.com/problems/backspace-string-compare/ Given two strings s and t, return true if they are equal when both are typed into empty text editors. ‘#’ means a backspace character. Note that after backspacing an empty text, the text will continue empty. Example 2: Input: s = “ab##”, t = “c#d#” Output: true Explanation: Both s and t become […]

Read More →