Narendra Kumar has Published 191 Articles

Minimum Number of Platforms Required for a Railway Station using C++.

Narendra Kumar

Narendra Kumar

Updated on 31-Oct-2019 07:35:09

303 Views

Problem statementGiven arrival and departure times of all trains that reach a railway station, the task is to find the minimum number of platforms required for the railway station so that no train waits.We are given two arrays that represent arrival and departure times of trains that stop.For below input, ... Read More

Minimum number of palindromes required to express N as a sum using C++.

Narendra Kumar

Narendra Kumar

Updated on 31-Oct-2019 07:30:17

207 Views

Problem statementGiven a number N, we have to find the minimum number of palindromes required to express N as a sum of themIf N = 15 then 2 palindromes are required i.e. 8 and 7.Algorithm1. Generate all the palindromes up to N in a sorted fashion 2. Find the size ... Read More

Minimum number of page turns to get to a desired page using C++.

Narendra Kumar

Narendra Kumar

Updated on 31-Oct-2019 07:26:43

564 Views

Problem statementGiven a book of N pages, the task is to calculate the minimum number of page turns to get to a give desired page K.we can either start turning pages from the front side of the book (i.e from page 1) or from the backside of the book (i.e ... Read More

Minimum number of operations required to sum to binary string S using C++.

Narendra Kumar

Narendra Kumar

Updated on 31-Oct-2019 07:24:59

219 Views

Problem statementGiven a binary string str. Find the minimum number of operations required to be performed to create the number represented by str. Only following operations can be performed −Add 2xSubtract 2xIf binary string is “1000” then we have to perform only 1 operation i.e. Add 23If binary string is ... Read More

Minimum number of operations required to delete all elements of the array using C++.

Narendra Kumar

Narendra Kumar

Updated on 31-Oct-2019 07:21:16

1K+ Views

Problem statementGiven an integer array arr, the task is to print the minimum number of operations required to delete all elements of the array. While deleting element following restriction is imposed −Any element from the array can be chosen at random and every element divisible by it can be removed ... Read More

Minimum number of operations on an array to make all elements 0 using C++.

Narendra Kumar

Narendra Kumar

Updated on 31-Oct-2019 07:18:01

468 Views

Problem statementGiven an array of size N and each element is either 1 or 0. The task is to calculated the minimum number of operations to be performed to convert all elements to zero. One can perform below operations −If an element is 1, You can change its value equal ... Read More

Minimum number of nodes in an AVL Tree with given height using C++.

Narendra Kumar

Narendra Kumar

Updated on 31-Oct-2019 07:15:22

334 Views

Problem statementGiven the height of an AVL tree, the task is to find the minimum number of nodes the tree can have.If height = 0 then AVL tree can have one 1 node If height = 5 then AVL tree can have minimum 20 nodesAlgorithmIn an AVL tree, we have ... Read More

Minimum number of moves to make all elements equal using C++.

Narendra Kumar

Narendra Kumar

Updated on 31-Oct-2019 07:12:57

254 Views

Problem statementGiven an array of N elements and an integer K., It is allowed to perform the following operation any number of times on the given array −Insert the Kth element at the end of the array and delete the first element of the array.The task is to find the ... Read More

Minimum number of mails required to distribute all the questions using C++.

Narendra Kumar

Narendra Kumar

Updated on 31-Oct-2019 07:04:38

115 Views

Problem statementGiven N questions in a test and K students in the class. Out of the batch of K students, N students memorized exactly one question each. A mail can contain about a maximum of X questions.Find the minimum number of mails required so that the entire class gets to ... Read More

Minimum number of letters needed to make a total of n in C++.

Narendra Kumar

Narendra Kumar

Updated on 31-Oct-2019 07:02:45

85 Views

Problem statementGiven an integer n and let a = 1, b = 2, c= 3, ….., z = 26. The task is to find the minimum number of letters needed to make a total of nIf n = 23 then output is 1 If n = 72 then output is ... Read More

Advertisements