Shubham Vora has Published 962 Articles

Java Program for Minimum Rotations Required to Get the same String

Shubham Vora

Shubham Vora

Updated on 14-Aug-2023 13:10:19

163 Views

In this tutorial, we need to write a Java program to count the total number of minimum required rotations to get the original string. We can solve the problem by getting the rotations substrings of the original string or concatenating the original string to itself. Problem statement − We have ... Read More

Java Program for Minimum Move to end Operations to Make all Strings Equal

Shubham Vora

Shubham Vora

Updated on 14-Aug-2023 13:05:47

98 Views

In this problem, we have given n strings and need to make all strings equal by rotating them. To solve the problem, we need to pick any string from the array and need make all strings equal by rotating them. Also, we need to count the total number of ... Read More

Generate String after Adding Spaces at Specific Positions in a given String

Shubham Vora

Shubham Vora

Updated on 14-Aug-2023 13:03:58

105 Views

In this problem, we need to add spaces before the given indexes in the string. We can use two different approaches to solve the problem. The first approach moves the characters of the given string to add space at a particular index, and the second approach replaces the characters of ... Read More

Find all Palindrome Strings in given Array of Strings

Shubham Vora

Shubham Vora

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

442 Views

We need to find all palindrome strings from the given array in this problem. The string is a palindrome if we can read it the same from the start and end. We can use two approaches to check whether the string is a palindrome. In the first approach, we reverse ... Read More

Decode a String Recursively Encoded as Count followed by Substring

Shubham Vora

Shubham Vora

Updated on 14-Aug-2023 13:00:40

163 Views

In this problem, we need to decode the given string by repeatedly adding the total count number of times. We can have three different approaches to solving the problem, and we can use two stacks or one stack to solve the problem. Also, we can solve the problem without ... Read More

Count the Number of Vowels and Consonants in a Linked List

Shubham Vora

Shubham Vora

Updated on 14-Aug-2023 12:58:00

106 Views

In this problem, we need to count the total vowels and constants in the given linked list. We can traverse the linked list and check for each character, whether it is a constant or vowel. Problem statement − We have given a linked list containing the lowercase alphabetical characters. We ... Read More

Count of each Lowercase Character after Performing described Operations for each Prefix of Length 1 to N

Shubham Vora

Shubham Vora

Updated on 14-Aug-2023 12:56:32

40 Views

In this problem, we need to perform the given operations with each string prefix. In the end, we need to count the frequency of each character. We can follow the greedy approach to solve the problem. We need to take each prefix of length K and update its characters according ... Read More

Check if a String is Present in the given Linked List as a Subsequence

Shubham Vora

Shubham Vora

Updated on 14-Aug-2023 12:46:30

148 Views

In this problem, we will check if the linked list contains the string as a subsequence. We can iterate the list and string together to check whether a string is present as a subsequence in the linked list. Problem statement − We have given a string of size N. Also, ... Read More

C++ Program for Generating Lyndon Words of Length n

Shubham Vora

Shubham Vora

Updated on 14-Aug-2023 12:42:40

54 Views

In this problem, we need to generate the Lyndon words of the length n using the given characters. The Lyndon words are words such that any of its rotations is strictly larger than itself in the lexicographical order. Here are examples of Lyndon words. 01 − The rotations ... Read More

Sort array of strings after sorting each string after removing characters whose frequencies are not a powers of 2

Shubham Vora

Shubham Vora

Updated on 10-Aug-2023 10:40:53

74 Views

In this problem, we need to remove the characters from the string whose frequency is not the power of 2. After that, we need to sort each string of the array in non-increasing order. Problem statement- We have given an array arr[] containing total N strings of different lengths. We ... Read More

Advertisements