Prabhdeep Singh has Published 188 Articles

Minimize the last remaining element of the Array by selecting pairs such that arr[i] >= arr[j] and replace arr[i] with arr[i] – arr[j]

Prabhdeep Singh

Prabhdeep Singh

Updated on 31-Aug-2023 12:20:15

132 Views

We are given an array of non-negative integers and we have to perform an operation of the given array any number of times possible so that we can choose any element of the array and can choose another element from the array that will be less than or equal to ... Read More

Count of triplets in Binary String such that Bitwise AND of S[i], S[j] and S[j], S[k] are same

Prabhdeep Singh

Prabhdeep Singh

Updated on 31-Aug-2023 12:06:32

199 Views

A binary string is a type of string which contains only binary characters that are '0' and '1'. We are given a binary string and have to find the triplets that fulfill the condition that the bitwise 'AND' of the first two characters is equal to the bitwise 'AND' ... Read More

Maximum distance between Peaks in the given Linked List

Prabhdeep Singh

Prabhdeep Singh

Updated on 31-Aug-2023 12:05:11

191 Views

A linked list is a linear data structure that stores the data in the nodes and each node contains the address of the next node to make the connection. A peak or the peak node is the node that is not present at the first or the last place and ... Read More

C++ Program to Find Mth element after K Right Rotations of an Array

Prabhdeep Singh

Prabhdeep Singh

Updated on 31-Aug-2023 12:03:45

133 Views

Right Rotations means we have to shift each element towards the right as the 0th index element shift to the 1st index, the 1st index element shift to the 2nd index, ..., and the last element shift to the 0th index. Here we have given an array of integers of ... Read More

Count elements in Array having strictly smaller and strictly greater elements present

Prabhdeep Singh

Prabhdeep Singh

Updated on 31-Aug-2023 12:01:24

259 Views

A number is strictly a smaller element means the number should be less than by a minimum difference is 1 and similarly strictly greater element means the number should be greater than by a minimum of difference 1. Here we have given an array of integers of size n and ... Read More

Minimize operations to convert K from 0 to B by adding 1 or A * 10^c in each step

Prabhdeep Singh

Prabhdeep Singh

Updated on 31-Aug-2023 11:59:45

153 Views

We are given an integer B and A, and we have to convert the number K from 0 to exactly B by applying the given operations in the minimum steps. We can increase the current number K by 1 i.e. K = K + ... Read More

Minimize cost to reduce Array if for choosing every 2 elements, 3rd one is chosen for free

Prabhdeep Singh

Prabhdeep Singh

Updated on 31-Aug-2023 11:51:21

228 Views

We are given an array it this problem and we have to remove all the elements of the array with the minimum cost required. We have to remove two elements at a time and add them to the total cost. Also, we can remove the third number without any cost ... Read More

Find the index at which bit must be set to maximize the distance between the next set bit

Prabhdeep Singh

Prabhdeep Singh

Updated on 31-Aug-2023 11:45:28

137 Views

We are given an array that contains the binary numbers that are '0', and '1' only. We have to make a one-bit set of the given array which was earlier not the set bit (there will be at least a bit present in the given array which will not be ... Read More

Find the winner of the game where X picks 1, then Y picks 2, then X picks 3, and so on

Prabhdeep Singh

Prabhdeep Singh

Updated on 31-Aug-2023 11:32:33

87 Views

There are two players, X and Y, who are playing a game. X will start the first and can pick 1 stone from the set of an unlimited number of stones after that Y will start and can pick the 2 stones, then X will pick 3, and so on ... Read More

Minimize the count of peaks and troughs in the given Array after at most one replacement

Prabhdeep Singh

Prabhdeep Singh

Updated on 31-Aug-2023 11:17:11

117 Views

Peaks are defined as the point or index in the array where are both left and right sides values are smaller than the value of that index. And Troughs are defined as the point or index of the array where are both left and right sides values are greater than ... Read More

Advertisements