DATA STRUCTURE


maazbinasad
Maaz Bin Asad 27 April, 2022

Print Matrix in Spiral Form

Problem Given an integer matrix, print it in spiral form Sample Input [1 2 3 4] [4 5 6 …

maazbinasad
Maaz Bin Asad 27 April, 2022

Shift all matrix elements by 1 in spiral order

Problem Given an M x N matrix, shift all its elements by 1 in spiral order Sample Input …

vinaykhatri
Vinay Khatri 29 March, 2022

Maximum Units

Problem You have to place a number of boxes into the truck. You are given a 2D array where each …

vinaykhatri
Vinay Khatri 29 March, 2022

Missing Numbers

Problem Given an integer array in which all numbers occur twice except 2. Find those two numbers…

vinaykhatri
Vinay Khatri 29 March, 2022

Monotonic Array

Problem Given an array. Check if it is monotonic increasing or decreasing. An array is monotonic…

vinaykhatri
Vinay Khatri 29 March, 2022

Binary Gap

Problem Given an integer ‘n’, find the maximum gap between two occurrences of 1. If …

vinaykhatri
Vinay Khatri 29 March, 2022

Arranging coins

Problem We've been given ‘n’ coins, and you're supposed to use them to build…

vinaykhatri
Vinay Khatri 16 March, 2022

Pass by Reference vs Pass by Pointer in C++

Pass by reference and pass by pointer are the two popular ways of passing variables to a function i…

vinaykhatri
Vinay Khatri 26 December, 2021

Find a pair with a minimum absolute difference in an array

Problem Given an unsorted array, find the minimum difference between any pair in a given array a…

vinaykhatri
Vinay Khatri 26 December, 2021

Find two non-overlapping pairs having the same sum in an array

Problem Given an unsorted array of integers. The task is to find any two non-overlapping pairs w…

vinaykhatri
Vinay Khatri 26 December, 2021

Find triplet having maximum product in an array

Problem Find 3 numbers from the array such that their product is maximum. Sample Input […

vinaykhatri
Vinay Khatri 26 December, 2021

Check if one string can be made another by swapping at most once

Problem Given two strings A and B, check if A can be made equal to B by swapping two characters …