Shubham Vora has Published 962 Articles

Count Substrings with at least one occurrence of first K alphabet

Shubham Vora

Shubham Vora

Updated on 29-Aug-2023 18:07:29

50 Views

In this problem, we need to count substrings containing a minimum 1 occurrence of all K characters. Here, we will use two different approaches to solve the problem. The first approach takes all substrings of the given string, checks whether the substring contains all K characters, and counts such ... Read More

Count of Strings of Array having given prefixes for Q query

Shubham Vora

Shubham Vora

Updated on 29-Aug-2023 17:59:57

123 Views

In this problem, we will count the number of strings containing query string as a prefix for each query string. We can traverse the list of query strings, and for each query, we can find a number of strings containing it as a prefix. Also, we can use ... Read More

Check if string S can be converted to T by incrementing characters

Shubham Vora

Shubham Vora

Updated on 29-Aug-2023 17:56:05

59 Views

In this problem, we will check whether it is possible to convert string S to T by incrementing the characters of S only once according to the given condition. Here, we can increment any characters by 'I' only once. So, If we need to increment any other character by ... Read More

Reconstruct original string from resultant string based on given encoding technique

Shubham Vora

Shubham Vora

Updated on 25-Aug-2023 17:03:39

47 Views

In this problem, we need to construct the original string from the given string. The given string is formed from the original string using the given rules. Here, we can use the given encryption rule and encrypted string to find the decrypted string by applying the encryption rule in reverse ... Read More

Python3 Program for Longest subsequence of a number having same left and right rotation

Shubham Vora

Shubham Vora

Updated on 25-Aug-2023 17:02:30

50 Views

In this problem, we will find the length of the longest subsequence of the given string such that it has the same left and right rotation. We can solve the problem by finding all subsequences of the given string and checking whether particular subsequences have the same left and ... Read More

Minimum Characters to be Replaced in given String to make all Characters Same

Shubham Vora

Shubham Vora

Updated on 25-Aug-2023 17:01:28

134 Views

In this problem, we will find a minimum number of string characters needed to be replaced to make all characters. In the first approach, we will find the minimum count of the replaceable characters by counting the frequency of each character in the given string. In another approach, we will ... Read More

Minimize Partitions in given String to get Another String

Shubham Vora

Shubham Vora

Updated on 25-Aug-2023 16:59:44

48 Views

In this problem, we need to construct one string by slicing the other string. We can use the longest common substring to solve the problem. We can find the longest common substring between both strings, slice str1 into 1 or 2 parts, and remove the substring from str2. Again, we ... Read More

Lexicographically Smallest String formed by Concatenating any prefix and its Mirrored form

Shubham Vora

Shubham Vora

Updated on 25-Aug-2023 16:57:58

83 Views

In this problem, we will find the lexicographically smallest string by concatenating the given string’s prefix and its reverse. We can find the lexicographically smallest prefix of the string and get the required string. Problem statement – We have given a string alpha containing the alphabetical characters. We need to ... Read More

Find the Valid Integer from given String

Shubham Vora

Shubham Vora

Updated on 25-Aug-2023 16:56:51

69 Views

In this problem, we need to extract the integer from the given string by following the rules in the problem statement. We can solve the problem by checking if the initial substring of the string follows each rule given for the valid integer value. Problem statement – We have given ... Read More

Find the String Among given Strings Represented using given Encryption Pattern

Shubham Vora

Shubham Vora

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

58 Views

In this problem, we need to find the original string from the encrypted string using the given encryption rules. We can get the original string if we use the encryption rules in reverse order. Problem statement – We have given an encrypted string. Also, we have given an array of ... Read More

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