Minimum Path Sum Leetcode Solution

Problem Statement The Minimum Path Sum LeetCode Solution – “Minimum Path Sum” says that given a n x m grid consisting of non-negative integers and we need to find a path from top-left to bottom right, which minimizes the sum of all numbers along the path. We can only move …

Read more

LRU Cache Leetcode Solution

Problem Statement The LRU Cache LeetCode Solution – “LRU Cache” asks you to design a data structure that follows Least Recently Used (LRU) Cache We need to implement LRUCache class that has the following functions: LRUCache(int capacity): Initializes the LRU cache with positive size capacity. int get(int key): Return the value …

Read more

Minesweeper LeetCode Solution

Problem Statement Minesweeper LeetCode Solution – Let’s play the minesweeper game (Wikipedia, online game)! You are given an m x n char matrix board representing the game board where: ‘M’ represents an unrevealed mine, ‘E’ represents an unrevealed empty square, ‘B’ represents a revealed blank square that has no adjacent mines (i.e., above, below, left, right, and all …

Read more

Serialize and Deserialize Binary Tree LeetCode Solution

Problem Statement Serialize and Deserialize Binary Tree LeetCode Solution – Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or transmitted across a network connection link to be reconstructed later in …

Read more

Combination Sum Leetcode Solution

The problem Combination Sum Leetcode Solution provides us an array or list of integers and a target. We are told to find the combinations that can be made using these integers any number of times that add up to the given target. So more formally, we can use the given …

Read more

Available Captures for Rook Leetcode Solution

Problem Statement In this problem, we are given a 2-D matrix that represents a chessboard with a white rook and some other pieces on it. White’s Rook is represented by the character ‘R’. White’s bishops are represented by ‘B’ and black’s pawns are represented as ‘p’. The problem guarantees that …

Read more

Multiply Strings Leetcode Solution

The problem Multiply Strings Leetcode solution asks us to multiply two strings which are given to us as input. We are required to print or return this result of multiplying to the caller function. So to put it more formally given two strings, find the product of the given strings. …

Read more

Translate »