Shubham Vora has Published 962 Articles

Print Nth Stepping or Autobiographical number

Shubham Vora

Shubham Vora

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

167 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

93 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

141 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

Minimum circular rotations to obtain a given numeric string by avoiding a set of given strings

Shubham Vora

Shubham Vora

Updated on 25-Aug-2023 15:59:09

64 Views

In this problem, we will find the number of rotations required to achieve the target string from the string containing N 0s. Also, we will skip the strings given in the array while making rotations. We can use the BFS algorithm to find the minimum rotations required to get the ... Read More

Python3 Program for Queries for Rotation and Kth Character of the given String in Constant Time

Shubham Vora

Shubham Vora

Updated on 25-Aug-2023 15:57:46

50 Views

In this problem, we need to perform the queries according to the given rules and print the characters from the updated string. We will solve the problem using two different approach. In the first approach, we will use the string rotation concept, and in the second approach, we will use ... Read More

Implementing Water Supply Problem using Breadth First Search

Shubham Vora

Shubham Vora

Updated on 25-Aug-2023 15:57:37

66 Views

In this problem, we will find the maximum number of cities to which we can supply water. We can consider this problem as a graph traversing the blocked node. So, we can use the breadth-first search algorithm to find the maximum number of connected cities. Problem Statement We have ... Read More

Find integral points with minimum distance from given set of integers using BFS

Shubham Vora

Shubham Vora

Updated on 25-Aug-2023 15:56:00

43 Views

In this problem, we will find the K points which are nearest to any of the given points from the points given in the array. To find the points which are nearest to the given points, we can take the nums[p] + 1 or nums[p] -1 for each element of ... Read More

Clockwise Triangular traversal of a Binary Tree

Shubham Vora

Shubham Vora

Updated on 25-Aug-2023 15:54:54

118 Views

In this problem, we will create a complete binary tree and traverse it in a circular clockwise direction. For the clockwise traversal, we can think of traversing the boundaries of the tree. For example, we can traverse the outer boundary of the tree first. After that, we can remove visited ... Read More

Check if the Left View of the given tree is sorted or not

Shubham Vora

Shubham Vora

Updated on 25-Aug-2023 15:53:45

68 Views

In this problem, we will check whether the left view of the binary tree is sorted. The left view of the binary tree means nodes we can see when we look at the binary tree from the left side. In simple terms, we can see only the first node of ... Read More

Program to convert given Binary to its equivalent ASCII character string

Shubham Vora

Shubham Vora

Updated on 25-Aug-2023 15:53:18

274 Views

In this problem, we need to convert the binary string to the character string. We can convert the binary string to an ASCII number string first, and then we can convert the character string. Problem statement – We have given a binary string bin_str whose size is multiple of 8. ... Read More

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