## Remove All Ones With Row and Column Flips Leetcode Solution

Problem Statement: Remove All Ones With Row and Column Flips Leetcode Solution – You are given an m x n binary matrix grid. In one operation, you can choose any row or column and flip each value in that row or column (i.e., changing all 0‘s to 1‘s, and all 1‘s to 0‘s). Return true if it is possible to …

## Minimum Increment to Make Array Unique Leetcode Solution

Problem Statement: Minimum Increment to Make Array Unique Leetcode Solution – You are given an integer array nums. In one move, you can pick an index i where 0 <= i < nums.length and increment nums[i] by 1. Return the minimum number of moves to make every value in nums unique. …

## Monotonic Array Leetcode Solution

Problem Statement: The Monotonic Array Leetcode Solution – Given an array is monotonic if it is either monotone increasing or monotone decreasing. An array nums is monotone increasing if for all i <= j, nums[i] <= nums[j]. An array nums is monotone decreasing if for all i <= j, nums[i] >= nums[j]. Given an integer array nums, return true if the given …

## Maximum Size Subarray Sum Equals k Leetcode Solution

Problem Statement: The Maximum Size Subarray Sum Equals k Leetcode Solution – Given an integer array nums and integer k, return the maximum length of a subarray that sums to k. If there is not one, return 0 instead. Example: Input: nums = [1,-1,5,-2,3], k = 3 Output: 4 Explanation:   The …

## H-Index Leetcode Solution

Problem Statement: H-Index Leetcode solution says that – Given an array of integers “citations” where citations[i] is the number of citations a researcher received for their ith paper, return researcher’s H-Index. If several H-Index values are present, return the maximum among them. Definition of H-Index:  A scientist has an index …

## High Five LeetCode Solution

Problem Statement: The High Five LeetCode Solution – Given a list of scores of different students named “item”, where the “item” has two fields item[0] represents the student’s id, and item[1] represents the student’s score eg. item[i]=[IDi, SCOREi] Return the answer as an array of pairs result, where result[j] = …

## Reveal Cards In Increasing Order Leetcode Solution

Problem Statement The Reveal Cards In Increasing Order Leetcode Solution – Given an integer Array named “deck”. In this deck of cards, every card has a unique integer. The integer on the i card is deck[i].  Order the deck in any order and all the cards start face down (unrevealed) …

## Maximum Side Length of a Square with Sum Less than or Equal to Threshold LeetCode Solution

Problem Statement “Maximum Side Length of a Square with Sum Less than or Equal to Threshold,” says that  a m x n matrix mat and an integer threshold are given, return the maximum side-length of a square with a sum less than or equal to threshold or return 0 if there is no such square. Example 1: Input: …

## Count Sub Islands LeetCode Solution

Problem Statement Count Sub Islands LeetCode Solution says that grid1 and grid2 contain only 0‘s (representing water) and 1‘s (representing land). The island means the group of 1’s connected 4 directionally. An island in grid2 is considered a sub-island if there is an island in grid1 that contains all the cells that make …

## Continuous Subarray Sum LeetCode Solution

Problem Statement Continuous Subarray Sum LeetCode Solution – Given an integer array nums and an integer k, return true if nums has a continuous subarray of the size of at least two whose elements sum up to a multiple of k, or false otherwise. An integer x is a multiple of k if there exists an integer n such that x = n * k. 0 is always a …

Translate »