Shubham Vora has Published 962 Articles

Find Last Palindrome String in the given Array

Shubham Vora

Shubham Vora

Updated on 17-Aug-2023 19:00:20

84 Views

In this problem, we need to find the last palindrome string in the array. If any string is the same in reading, either we start to read from the start or end, we can say the string is a palindrome. We can compare the starting and ending characters to check ... Read More

Find any permutation of Binary String of given size not present in Array

Shubham Vora

Shubham Vora

Updated on 17-Aug-2023 17:48:54

104 Views

In this problem, we need to find all missing binary strings of length N from the array. We can solve the problem by finding all permutations of a binary string of length N and checking which permutations are absent in the array. Here, we will see iterative and recursive approaches ... Read More

Count of substrings containing exactly K distinct vowels

Shubham Vora

Shubham Vora

Updated on 17-Aug-2023 17:46:47

150 Views

In this problem, we need to count the total number of substrings of string str containing exactly K distinct vowels. We can solve the problem in two different ways. The first approach is to traverse all substrings and count the number of vowels in each substring. We can also use ... Read More

Count of K length substrings containing exactly X vowels

Shubham Vora

Shubham Vora

Updated on 17-Aug-2023 17:44:40

43 Views

In this problem, we need to find a total number of substrings of length K containing exactly K vowels. We will see two different approaches to solving the problem. We can use a naïve approach that checks the number of vowels in each substring of length K. Also, we can ... Read More

Check if substring S1 appear after any occurrence of substring S2 in given sentence

Shubham Vora

Shubham Vora

Updated on 17-Aug-2023 17:42:43

187 Views

In this problem, we need th check whether the substring S1 appears after any occurrence of the substring S2 in the given string S. We can compare the starting index of S1 and S2 in the string S to solve the problem. Problem statement – We have given three substrings ... Read More

Check if any permutation of a given string is lexicographically larger than the other given string

Shubham Vora

Shubham Vora

Updated on 17-Aug-2023 17:39:46

71 Views

We have given two strings and need to check whether the given string's permutations exist such that one permutation can have a larger character than another permutation at the ith index. We can solve the problem by sorting the string and comparing each character of the string one by one. ... Read More

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

Shubham Vora

Shubham Vora

Updated on 17-Aug-2023 17:37:18

58 Views

In this problem, we need to find the maximum length of the sub sequence with the same left and right rotations. The left rotation means moving all characters of the string in the left direction and the first character at the end. The right rotation means moving all string characters ... Read More

Average value of set bit count in given Binary string after performing all possible choices of K operations

Shubham Vora

Shubham Vora

Updated on 17-Aug-2023 17:34:43

54 Views

In this problem, we need to find the average value of the count of set bits after performing K operations of all choices on the given string. There can be a brute force approach to solve the problem, but we will use the probability principles to overcome the time ... Read More

Count of K length substring containing at most X distinct vowels

Shubham Vora

Shubham Vora

Updated on 17-Aug-2023 17:31:46

78 Views

In this problem, we need to find the total number of sub strings of length K containing at most X distinct vowels. We can solve the problem in two different ways. The first way is to get all sub strings and count distinct vowels in each sub string of length ... Read More

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

Shubham Vora

Shubham Vora

Updated on 17-Aug-2023 17:16:20

136 Views

In this problem, we need to find the length of the longest subsequence having the same left and right rotations. We can solve the problem using the brute-force approach, finding all possible subsequences of the given string and checking each subsequence one by one to see if it has the ... Read More

Advertisements