Shubham Vora has Published 962 Articles

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

51 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

40 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

55 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

39 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

100 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

63 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

229 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

Check if cells numbered 1 to K in a grid can be connected after removal of atmost one blocked cell

Shubham Vora

Shubham Vora

Updated on 25-Aug-2023 15:52:11

35 Views

In this problem, we will check whether we can connect all K cells by unblocking any single cell. To solve the problem, we will assume all connected K as a single Island. If any single blocked cell can connect all Island of the matrix, it is only possible to connect ... Read More

Minimum Number of Insertions in given String to Remove Adjacent Duplicates

Shubham Vora

Shubham Vora

Updated on 25-Aug-2023 15:49:58

54 Views

In this problem, we will count the minimum number of characters we need to insert to remove all adjacent duplicate characters. To solve the problem, we need to count the total number of adjacent duplicate character pairs. Problem statement – We have given a string named str containing N ... Read More

Boundary Level order traversal of a Binary Tree

Shubham Vora

Shubham Vora

Updated on 25-Aug-2023 15:49:41

89 Views

In this problem, we will traverse each boundary of the given binary tree in the given order. We will use the recursive approach to traverse each boundary of the binary tree one by one. However, we will also learn the iterative approach using a stack to traverse the binary tree's ... Read More

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