Find Two Numbers in an Array Which Sum Up to K
Problem Statement Given an array of integers, find out two indices such that the sum of the numbers at that indices matches K. For example, {4, 6, 8, 1, 9} and K = 15, the output…
Problem Statement Given an array of integers, find out two indices such that the sum of the numbers at that indices matches K. For example, {4, 6, 8, 1, 9} and K = 15, the output…
Problem Statement Determine if a sudoku is Valid. Solution Explanation Given a sudoku grid, we need to verify if the already filled in numbers doesn't violate the sudoku rules. The rules are very simple, Each…
Problem Statement Given a number 'n', generate all factor combinations. For example, when n=24, the result would be [[2, 3, 3], [2, 9], [3, 6]] Solution Explanation As we know, every integer can be…
Problem Statement Given a single linked list, verify if the list has a cycle. A linked list has a cycle if a node's reference points back to an earlier node in the chain. Example: 1…
Problem Statement Given an array 'stocks' in which each value at index 'i' is the stock price on day 'i', Find the maximum profit you can make by performing atmost one Buy and one Sell…