Prabhdeep Singh has Published 188 Articles

Maximum count of 0s between two 1s in the given range for Q queries

Prabhdeep Singh

Prabhdeep Singh

Updated on 17-May-2023 14:41:15

327 Views

A binary string is a string that only contains the zeroes and ones as the different characters in them. We are given a binary string and an array of a given length that will contain the pairs. Each pair defines the range, and in that range, we have to return ... Read More

Minimum cost for constructing the subsequence of length K from given string S

Prabhdeep Singh

Prabhdeep Singh

Updated on 17-May-2023 14:39:01

255 Views

We will be given a string of length n, an integer k, and an integer array of length 26. The integer array defines the cost of each lowercase character and the string will contain only lowercase letters. We have to create a subsequence of length k from the given string ... Read More

Find an N-length Binary String having maximum sum of elements from given ranges

Prabhdeep Singh

Prabhdeep Singh

Updated on 17-May-2023 14:36:19

226 Views

We will be given an array that will contain the pairs which represent the range and their value will range from 0(inclusive) to N(exclusive). Here, N is the size of the binary string which we have to return as the answer. For all the given ranges we have to maximize ... Read More

Sort an array by swapping adjacent elements from indices that contains ‘1’ in a given string

Prabhdeep Singh

Prabhdeep Singh

Updated on 17-May-2023 14:33:57

482 Views

Sorting an array means ordering all the elements of the array in increasing order. Sorting an array by swapping adjacent elements means we can only swap elements that are adjacent to each other but we can swap adjacent elements any number of times. We will be given a binary string ... Read More

Minimum number of flipping adjacent bits required to make given Binary Strings equal

Prabhdeep Singh

Prabhdeep Singh

Updated on 17-May-2023 14:30:48

461 Views

A binary string is a string that contains only two different types of characters 0 and 1. We will be given two binary strings of the same length and our task is to make both of them equal by toggling two adjacent characters of the first string. Also, we have ... Read More

Max count of N using digits of M such that 2 and 5, and, 6 and 9 can be treated as same respectively

Prabhdeep Singh

Prabhdeep Singh

Updated on 16-May-2023 13:52:56

219 Views

Max count is a count which is the maximum possible. Here we have given an integer N and a string of integer M. Our task is to return the maximum count of making the number N using the digits of the string of integer M. Also given that, we can ... Read More

Find the smallest number formed by inserting a given digit

Prabhdeep Singh

Prabhdeep Singh

Updated on 16-May-2023 13:50:26

373 Views

Inserting a number in the given number means adding a new given digit in the given number either at the front, end, or in between the numbers. We have given a number and a digit and have to add the digit in the number in a way such that the ... Read More

Maximize the missing values in a given time in HH:MM format

Prabhdeep Singh

Prabhdeep Singh

Updated on 16-May-2023 13:46:32

162 Views

A string will be given to us of length five which represents the time in the HH:MM format. There may be some ‘?’ present in the string and we have to replace them with any number such that the result is the valid time which could be the maximum possible. ... Read More

Generate all possible strings formed by replacing letters with given respective symbols

Prabhdeep Singh

Prabhdeep Singh

Updated on 16-May-2023 13:41:10

316 Views

Generating all possible strings is to replace a character of a string with a respective symbol and produce all possible strings. We will be given a string ‘s’ of size ‘N’ and an unordered map ‘mp’ of a pair of characters of size ‘M’. Here we can replace the mp[i][0] ... Read More

Find Binary string by converting all 01 or 10 to 11 after M iterations

Prabhdeep Singh

Prabhdeep Singh

Updated on 16-May-2023 13:38:01

231 Views

A binary string is a string that consists of only two different types of characters and that is ‘0’ and ‘1’. We will be given a binary string and the number m. We have to apply the operation to convert all the consecutive occurrences of the 0 and 1 that ... Read More

Advertisements