Shubham Vora has Published 957 Articles

Count the Number of Vowels and Consonants in a Linked List

Shubham Vora

Shubham Vora

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

253 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

103 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

231 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

132 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

145 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

Reorder characters of a string to valid English representations of digits

Shubham Vora

Shubham Vora

Updated on 10-Aug-2023 10:39:25

114 Views

In this problem, we need to reorder the characters of a given string to valid English representations of digits. The first approach can be to find all permutations of the string, extract the English words related to numeric digits, and convert them to digits. Another approach that can be used ... Read More

Reduce a string to a valid email address of minimum length by replacing specified substrings

Shubham Vora

Shubham Vora

Updated on 10-Aug-2023 10:36:28

116 Views

In this problem, we have given the email string containing the ‘dot’ and ‘at’ words. We need to replace them with ‘.’ And ‘@’ characters. Note – The valid email address should contain the ‘@’ character only once. It should contain any prefixes before the ‘@’ character and the ... Read More

Number of substrings having an equal number of lowercase and uppercase letters

Shubham Vora

Shubham Vora

Updated on 10-Aug-2023 10:30:04

300 Views

In this problem, we need to count the total number of strings of the given string containing an equal number of lowercase and uppercase characters. The naïve approach to solving the problem is to find all substrings and count the total number of substrings with an equal number of lowercase ... Read More

Modify a string by circularly shifting each character to the right by respective frequencies

Shubham Vora

Shubham Vora

Updated on 10-Aug-2023 10:28:16

205 Views

In this problem, we need to right-shift each character of a given string by its frequency. To solve the problem, we can count the frequency of each character and store it in a data structure like an array or map. After that, we can use the ASCII values of the ... Read More

Minimum subsequences of a string A required to be appended to obtain the string B

Shubham Vora

Shubham Vora

Updated on 10-Aug-2023 10:26:30

274 Views

In this problem, we need to construct the str2 by using the subsequences of the str1. To solve the problem, we can find subsequences of the str1 so that it can cover the substring with a maximum length of str2. Here, we will learn two different approaches to solving the ... Read More

Advertisements