Shubham Vora has Published 962 Articles

Lexicographically Smallest String formed by Concatenating any prefix and its Mirrored form

Shubham Vora

Shubham Vora

Updated on 25-Aug-2023 16:57:58

105 Views

In this problem, we will find the lexicographically smallest string by concatenating the given string’s prefix and its reverse. We can find the lexicographically smallest prefix of the string and get the required string. Problem statement – We have given a string alpha containing the alphabetical characters. We need to ... Read More

Find the Valid Integer from given String

Shubham Vora

Shubham Vora

Updated on 25-Aug-2023 16:56:51

90 Views

In this problem, we need to extract the integer from the given string by following the rules in the problem statement. We can solve the problem by checking if the initial substring of the string follows each rule given for the valid integer value. Problem statement – We have given ... Read More

Find the String Among given Strings Represented using given Encryption Pattern

Shubham Vora

Shubham Vora

Updated on 25-Aug-2023 16:54:02

66 Views

In this problem, we need to find the original string from the encrypted string using the given encryption rules. We can get the original string if we use the encryption rules in reverse order. Problem statement – We have given an encrypted string. Also, we have given an array of ... Read More

Find Largest Valued Even Integer which is a Non-Empty Substring of S

Shubham Vora

Shubham Vora

Updated on 25-Aug-2023 16:47:15

91 Views

In this problem, we need to find the largest even valued substring of the given string. The even string always contains the 2, 4, 6, 8, 0 at last. So, we can take all substrings of the given string, and if any substring is even and greater than the maximum ... Read More

Encoding a Sentence into Pig Latin

Shubham Vora

Shubham Vora

Updated on 25-Aug-2023 16:38:23

154 Views

In this problem, we will convert the sentence into Pig Latin. We can append the first character of each word at the last and append ‘ay’ after that. We will see three approaches to convert the given sentence into the Pig Latine. The logic is we can append the first ... Read More

Check if Words in given Sentence Occur based on the given Pattern

Shubham Vora

Shubham Vora

Updated on 25-Aug-2023 16:33:06

78 Views

In this problem, we need to check whether the string follows the given pattern. We can solve the problem by mapping each character to the word. If any character of the pattern maps more than one word, we can say that the string is not following the pattern. Problem statement ... Read More

Shortest String formed by Concatenating String A x Times and B y Times such that n(A)\x = n(B)*y

Shubham Vora

Shubham Vora

Updated on 25-Aug-2023 16:09:10

69 Views

In this problem, we need to find the shortest string, which is a multiple of string A and string B. The problem is very similar to finding the LCM (Least common multiplier) of two numbers. We can find the LCM of both strings’ lengths and make both strings’ lengths equal ... Read More

Sum and product of K smallest and largest Fibonacci numbers in the array

Shubham Vora

Shubham Vora

Updated on 25-Aug-2023 16:08:46

90 Views

In this problem, we will find the sum and product of the K maximum and minimum Fibonacci numbers in the array. The given problem is very basic and aims to focus on improving the problem-solving skills of beginners. The main goal of the problem is to introduce how to filter ... Read More

Python3 Program to Find Maximum number of 0s placed consecutively at the start and end in any rotation of a Binary String

Shubham Vora

Shubham Vora

Updated on 25-Aug-2023 16:04:27

70 Views

In this problem, we will write the Python code to count the maximum sum of consecutive zeros at the start and end of the string. The problem solution can be divided into two parts. The first part is finding all rotations of the string. The second part is finding ... Read More

Print updated levels of each node of a Complete Binary Tree based on difference in weights of subtrees

Shubham Vora

Shubham Vora

Updated on 25-Aug-2023 16:04:10

50 Views

In this problem, we will update the level of each child node based on the left and right subtree's weight difference. Here, we will recursively traverse the subtree of each node to get the weight of the left and right subtree. After that, we will again traverse each subtree node ... Read More

Previous 1 ... 6 7 8 9 10 ... 97 Next
Advertisements