Sort 0, 1, 2 in an array – Part 2

Given an array of numbers, that consists only of three types of integers, which are 0, 1, and 2. Write … Read more

Sort 0, 1, 2 in an array – Part 1

Given an array of numbers that consists only of three types of integers, which are 0, 1 and 2. Write … Read more

Sum of all the overlapping elements

Given two arrays of integers. Write a program to find the sum of all the overlapping elements between two arrays. … Read more

Find the Number of Contiguous Parking Areas

Problem: Given a building with parking slots. If a spot is free then it is marked by 1 and if … Read more

What is a Pascal Triangle?

Given a number N, write a program to print the first N lines of the Pascal triangle. Pascal Triangle: Note: … Read more

Minimum number of adjacent swaps to sort the given array

Given an array of integers, you are allowed to swap only adjacent elements in the array. write a program to … Read more

Maximum meetings in one room

You have one meeting room at your company. There are N meeting needs to take place. Every meeting has a … Read more

Find the number of pairs with even XOR

Given an array of integers, write a program to find the number of pairs for which the XOR is an … Read more

Given an array, Find the number of all pairs with even sum

Objective: Given an array of integers, write a program to find the number of pairs with even sum. Example: Given … Read more

The number of cycles in a given array of integers.

Objective: Given an array of size N which contains integers from range 0 to N-1. (No duplicates). Write a program … Read more

Check if given sudoku is valid or not

Problem: Given a filled sudoku, write a program to check if sudoku is valid or following all of its rules. … Read more