Max of All Subarrays of Size k Using Max Heap in C++

This problem, also referred to as the “sliding window maximum” problem, can be efficiently solved using heaps. We’ve already discussed an O(n) solution.

Finding the Next Lexicographically Greater Permutation

Given an input sequence in the form of an array, find the lexicographically next greater permutation if it exists.

Search a sorted 2D Matrix

This method has the limitation that it will work for only those matrix where the first integer of each row is greater than the last integer of the previous row.

Array Indices with Equal sum | Equal Number of Odd or Even numbers on both sides

Given an array, find the indices where the sum of numbers on the left equals the sum on the right.

Coin Change II – LeetCode Solution [Medium]

You are given an integer array coins representing coins and an integer amount. Return the number of combinations that make up that amount.

Coin Change – LeetCode Solution [Medium]

You are given an integer vector coins[n] representing coins of different denominations and an integer amount representing a total amount of money.

Minimum Moves to Equal Array Elements – LeetCode Solution [Medium]

When we increment n – 1 elements, the relative difference between the highest number and all other numbers effectively decreases by 1.

Minimum adjacent swaps required to sort Binary Array in O(n) | Amazon Interview Question

Given an array consisting of only 1s and 0s, sort this binary array such that all 0s are on the left and all 1s are on the right.

Array Manipulation | HackerRank Solution [Hard]

Starting with a 1-indexed array of zeros and a list of operations, for each operation add a value to each the array element between two given indices, inclusive. Once all operations have been performed, return the maximum value in the array.

Sherlock and MiniMax | HackerRank Solution [Hard]

Given an integer range, for all M in that inclusive range, determine the minimum – abs(arr[i]-M) for all i