Home
Gaurav's GitHub Page
Cancel

Swapping pairs make sum equal (geeksforgeeks - SDE Sheet)

PROBLEM DESCRIPTION Given two arrays of integers a[] and b[] of size n and m, the task is to check if a pair of values (one value from each array) exists such that swapping the elements of the pai...

Largest Number formed from an Array (geeksforgeeks - SDE Sheet)

PROBLEM DESCRIPTION Given an array of strings arr[] of length n representing non-negative integers, arrange them in a manner, such that, after concatenating them in order, it results in the larges...

Stock span problem (geeksforgeeks - SDE Sheet)

PROBLEM DESCRIPTION The stock span problem is a financial problem where we have a series of n daily price quotes for a stock and we need to calculate the span of stocks price for all n days. The s...

Coin Change (Count Ways) (geeksforgeeks - SDE Sheet)

PROBLEM DESCRIPTION Given an integer array coins[ ] of size N representing different denominations of currency and an integer sum, find the number of ways you can make sum by using different combi...

K-th element of two Arrays (geeksforgeeks - SDE Sheet)

PROBLEM DESCRIPTION Given two sorted arrays arr1 and arr2 and an element k. The task is to find the element that would be at the kth position of the combined sorted array. geeksforgeeks SOLUTION...

Stock buy and sell (geeksforgeeks - SDE Sheet)

PROBLEM DESCRIPTION The cost of stock on each day is given in an array A[] of size N. Find all the segments of days on which you buy and sell the stock such that the sum of difference between sell...

Spirally traversing a matrix (geeksforgeeks - SDE Sheet)

PROBLEM DESCRIPTION You are given a rectangular matrix, and your task is to return an array while traversing the matrix in spiral form. geeksforgeeks SOLUTION class Solution { // Function ...

K Sized Subarray Maximum (geeksforgeeks - SDE Sheet)

PROBLEM DESCRIPTION Given an array arr[] of size N and an integer K. Find the maximum for each and every contiguous subarray of size K. geeksforgeeks SOLUTION class Solution { static ArrayL...

Largest subarray with 0 sum (geeksforgeeks - SDE Sheet)

PROBLEM DESCRIPTION Given an array having both positive and negative integers. The task is to compute the length of the largest subarray with sum 0. geeksforgeeks SOLUTION class GfG { int m...

Minimum Platforms (geeksforgeeks - SDE Sheet)

PROBLEM DESCRIPTION Given arrival and departure times of all trains that reach a railway station. Find the minimum number of platforms required for the railway station so that no train is kept wai...