Hafeezul Kareem has Published 328 Articles

K’th Boom Number in C++

Hafeezul Kareem

Hafeezul Kareem

Updated on 09-Apr-2021 12:36:39

231 Views

In this tutorial, we are going to write a program that finds the k-th boom number.The number that contains only 2 and 3 are called boom number.Let's see the steps to solve the above problem.Initialise the value of k.Initialise a queue of strings.Push the empty string to the queue.Initialise a ... Read More

K-th smallest element after removing some integers from natural numbers in C++

Hafeezul Kareem

Hafeezul Kareem

Updated on 09-Apr-2021 12:36:15

254 Views

In this tutorial, we are going to write a program that finds out the smallest element after removing some integers from the natural numbers.We have given an array of elements and k value. Remove all the elements from natural numbers that are present in the given array. And then find ... Read More

k-th missing element in sorted array in C++

Hafeezul Kareem

Hafeezul Kareem

Updated on 09-Apr-2021 12:35:55

292 Views

In this tutorial, we are going to write a program that finds out the k-th missing element in the given sorted array.Find the k-th number that is missing from min to max in the given unsorted array. Let's see the steps to solve the problem.Initialise the sorted array.Initialise two variables ... Read More

k-th missing element in an unsorted array in C++

Hafeezul Kareem

Hafeezul Kareem

Updated on 09-Apr-2021 12:35:02

175 Views

In this tutorial, we are going to write a program that finds out the k-th missing element in the given unsorted array.Find the k-th number that is missing from min to max in the given unsorted array. Let's see the steps to solve the problem.Initialise the unsorted array.Insert all the ... Read More

K-th Greatest Element in a Max-Heap in C++

Hafeezul Kareem

Hafeezul Kareem

Updated on 09-Apr-2021 12:34:24

1K+ Views

In this tutorial, we are going to write a program that finds the k-th largest element from the max-heap.We will use priority queue to solve the problem. Let's see the steps to complete the program.Initialise the max-heap with correct values.Create a priority queue and insert the root node of the ... Read More

K-th Element of Two Sorted Arrays in C++

Hafeezul Kareem

Hafeezul Kareem

Updated on 09-Apr-2021 12:28:57

161 Views

In this tutorial, we are going to write a program that finds the k-th element from thee merged array of two sorted arrays.Let's see the steps to solve the problem.Initialise the two sorted arrays.Initialise an empty array of size m + n.Merge the two arrays into the new array.Return the ... Read More

K-th digit in ‘a’ raised to power ‘b’ in C++

Hafeezul Kareem

Hafeezul Kareem

Updated on 09-Apr-2021 12:27:43

332 Views

In this tutorial, we are going to write a program that finds the k-th digit from the right side in the number abIt's a straightforward problem. Let's see the steps to solve it.Initialise the numbers a, b, and k.Find the value of abusing pow method.Write a loop that iterates until ... Read More

k-Rough Number or k-Jagged Number in C++

Hafeezul Kareem

Hafeezul Kareem

Updated on 09-Apr-2021 12:26:56

215 Views

In this tutorial, we are going to write a program that checks whether the given number is k-rough or k-jagged number or not.The number whose smallest prime factor is greater than or equal to the given k, it is called k-rough or k-jagged number.Let's see the steps to solve the ... Read More

Find any one of the multiple repeating elements in read only array in C++

Hafeezul Kareem

Hafeezul Kareem

Updated on 01-Feb-2021 12:22:06

95 Views

In this tutorial, we are going to write a program that finds the repeating element in the given array.Let's see the steps to solve the problem.Initialize the array.Initialize a counter map to store the frequency of each element in the array.Iterate over the array.Count each element.Print the element whose frequency ... Read More

Find amount of water wasted after filling the tank in C++

Hafeezul Kareem

Hafeezul Kareem

Updated on 01-Feb-2021 12:18:23

305 Views

In this tutorial, we are going to solve the following problem.Given a tank with a capacity of N liters and a pump that fill the tank with S speed per minute. Unfortunately, there is a hole in the tank. And water is wasting at a speed of WS per minute ... Read More

Advertisements