Shubham Vora has Published 962 Articles

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

66 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

136 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

69 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

58 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

81 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

54 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

44 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

Print Nth Stepping or Autobiographical number

Shubham Vora

Shubham Vora

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

141 Views

In this problem, we will print the Nth Stepping number. The naïve approach for solving the problem is to traverse natural numbers, check whether each number is a Stepping number, and find the Nth Stepping number. Another approach can be using the queue data structure. Problem Statement We have ... Read More

Print all Exponential Levels of a Binary Tree

Shubham Vora

Shubham Vora

Updated on 25-Aug-2023 16:01:21

85 Views

In this problem, we will print all exponential levels of the binary tree. We will use the level order traversal to traverse through each level of the binary tree. After that, we will find minimum P and q values using the first element of the level. In the next ... Read More

Minimum difference between maximum and minimum value of Array with given Operations

Shubham Vora

Shubham Vora

Updated on 25-Aug-2023 16:00:17

124 Views

In this problem, we will find the minimum difference between minimum and maximum array elements after multiplying or dividing any array elements with K. The simple approach to solving the problem is dividing each element of the array with K if divisible, multiplying each element with K, and tracking the ... Read More

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