## Longest Remaining Time First (LRTF) CPU Scheduling Program

Prerequisite – CPU Scheduling | Longest Remaining Time First (LRTF) algorithm We have given some process with arrival time and Burst Time and we have… Read More »

## Minimum sum after subtracting multiples of k from the elements of the array

Given an integer and an integer array , the task is to find the minimum possible sum of all the elements of the array after… Read More »

## Maximum number of parallelograms that can be made using the given length of line segments

Given N line segments where the length of the ith line segment is . The task is to find the maximum number of parallelograms can… Read More »

## Distribution of candies according to ages of students

Given two integer arrays and where stores the ages of different students and an element of stores the number of candies that packet has (complete… Read More »

## Maximum students to pass after giving bonus to everybody and not exceeding 100 marks

Given an array which represents the marks of students. The passing grade is and maximum marks that a student can score is , the task… Read More »

## Sum of first N natural numbers which are not powers of K

Given two integers and , the task is to find the sum of all the numbers within the range [1, n] excluding the numbers which… Read More »

## Find a palindromic string B such that given String A is a subsequense of B

Given a string . Find a string , where B is a palindrome and A is a subsequence of B. A subsequence of a string… Read More »

## Find two numbers whose sum and GCD are given

Given sum and gcd of two numbers and . The task is to find both the numbers a and b. If the numbers do not… Read More »

## Maximum litres of water that can be bought with N Rupees

Given Rupees. A liter plastic bottle of water costs Rupees and a litre of glass bottle of water costs Rupees. But the empty glass bottle… Read More »

## Minimum number of 1’s to be replaced in a binary array

Given a binary array arr[] of zero’s and one’s only. The task is to find the minimum number of one’s to be changed to zero… Read More »

## Count subarrays with Prime sum

Given an array A[] of integers. The task is to count total subarrays whose sum is prime with ( size > 1 ). Examples: Input… Read More »

## Partition an array such into maximum increasing segments

We are given an array of N integers, we need to partition the array into segments such that every element of a segment is greater… Read More »

## Number of closing brackets needed to complete a regular bracket sequence

Given an incomplete bracket sequence S. The task is to find the number of closing brackets ‘)’ needed to make it a regular bracket sequence… Read More »

## Lexicographically smallest permutation with no digits at Original Index

Given an integer N. The task is to find the lexicographically smallest permutation of integer of the form: 12345…N such that no digit occurs at… Read More »

## Find number from given list for which value of the function is closest to A

Given a function F(n) = P – (0.006 * n), where P is given. Given a list of integers and a number, . The task… Read More »