Prabhdeep Singh has Published 188 Articles

Find the winner of game of repeatedly removing the first character to empty given string

Prabhdeep Singh

Prabhdeep Singh

Updated on 24-Aug-2023 15:51:29

128 Views

In this game, we are given an array of strings of length N. Each string consists of the digits 1 to N only. The game starts with the first person and removes the first character of the 0th index, then the removed character from the string digit number player will ... Read More

Count levels in a Binary Tree consisting of nodes valued 1 grouped together

Prabhdeep Singh

Prabhdeep Singh

Updated on 24-Aug-2023 15:47:42

277 Views

A binary tree is a tree where each node has a maximum of two children. We are given a binary tree that consists of only 0 and 1 as the node values. We have to find the number of levels of the binary tree that consists of at least one ... Read More

Minimize cost to convert all characters of a binary string to 0s

Prabhdeep Singh

Prabhdeep Singh

Updated on 24-Aug-2023 14:29:16

173 Views

A binary string is a string that only contains the binary numbers in it. In this problem, we are given a binary string, an array that represents the last index up to which we can flip the ones after starting from the ith index which will cost and cost for ... Read More

Maximize product of array by replacing array elements with its sum or product with element from another array

Prabhdeep Singh

Prabhdeep Singh

Updated on 24-Aug-2023 14:26:07

235 Views

We are given two arrays of the same length and we have to apply some operations to get the product of the first array with all elements maximum. The operations are to multiply or add any element of the second array only once to any element of the first array ... Read More

Difference between Queue and Deque in C++

Prabhdeep Singh

Prabhdeep Singh

Updated on 24-Aug-2023 14:24:13

1K+ Views

Queue and Deque both are linear data structures that are defined in STL of C++ programming language. Queue works on the principle of the first in first out, the element added to the queue first will be removed first, on the other hand, deque has properties to add an element ... Read More

Distance of each node of a Binary Tree from the root node using BFS

Prabhdeep Singh

Prabhdeep Singh

Updated on 24-Aug-2023 14:21:07

178 Views

Binary Tree is a non-linear data structure. It has a maximum of two children and each node contain three things that are data value, left and right pointer. The top node is called the root node and the last node which does contain any children is called the leave node. ... Read More

Find the Largest and smallest number in an Array containing small as well as large numbers

Prabhdeep Singh

Prabhdeep Singh

Updated on 24-Aug-2023 14:19:04

210 Views

We are given an array of strings and each string represents a number that could be more than the range of the maximum integer limit. We have to find the largest and the smallest element from the given array. We cannot use the simple less than or greater than operators ... Read More

Longest Substring containing C2, starting with C1 and ending with C3

Prabhdeep Singh

Prabhdeep Singh

Updated on 24-Aug-2023 14:17:12

108 Views

A substring is a string that can be achieved from the given string by removing some characters from the beginning and end of the string (possibly none or all). We are given a string and three characters and have to find the longest substring that contains all the three given ... Read More

Count of N length Strings having S as a Subsequence

Prabhdeep Singh

Prabhdeep Singh

Updated on 24-Aug-2023 14:15:40

209 Views

We are given a string of length S and given an another number n which represents the length of the strings which might contains S as the subsequence. We have to find the number of unique strings of length N which contains S as the subsequence, where a subsequence is ... Read More

Count of Subsequences of given string X in between strings Y and Z

Prabhdeep Singh

Prabhdeep Singh

Updated on 24-Aug-2023 14:13:15

235 Views

A subsequence is a string that can be achieved from another string by removing some (possibly none or all) from a given string that may not be continuous. We are given a string and have to find the number of subsequences that are greater than equal to the given string ... Read More

Previous 1 ... 3 4 5 6 7 ... 19 Next
Advertisements