String

Level: Advanced

1. Write a function to find the minimum number of operations to convert one string to another using insertion, deletion, and substitution.
2. Implement a function to find the longest subsequence which is a palindrome.
3. Write a function to find the shortest common supersequence of two strings.
4. Implement a function to find the longest subsequence which is repeated k times.
5. Write a function to check if a string can be made palindrome by removing at most k characters.
6. Implement a function to find the longest substring where the difference between the number of distinct characters is at most k.
7. Write a function to find the number of ways to decode a string of digits.
8. Implement a function to find the length of the longest substring which can be rearranged to form a palindrome.
9. Write a function to find the minimum number of swaps to make a string palindrome.
10. Implement a function to find the length of the longest balanced substring.
11. Write a function to find the number of palindromic partitions of a string.
12. Implement a function to find the length of the longest substring with equal number of vowels and consonants.
13. Write a function to find the smallest rotation of a string which is lexicographically smallest.
14. Implement a function to find the number of distinct palindromic subsequences in a string.
15. Write a function to find the length of the longest alternating substring.
16. Implement a function to find the number of substrings with exactly k distinct characters.
17. Write a function to find the length of the longest substring with at most k distinct characters.
18. Implement a function to find the longest substring with at most k changes allowed.
19. Write a function to find the number of palindromic subsequences in a string.
20. Implement a function to find the longest substring with equal number of 0s, 1s, and 2s.
21. Write a function to find the number of substrings with equal number of 0s, 1s, and 2s.
22. Implement a function to find the number of distinct subsequences of a string modulo a given number.
23. Write a function to find the lexicographically smallest subsequence of a string.
24. Implement a function to find the number of substrings where the number of distinct characters is exactly k.
25. Write a function to find the length of the longest substring which contains at most k distinct vowels.
26. Implement a function to find the number of substrings where the number of distinct vowels is exactly k.
27. Write a function to find the length of the longest substring which contains at most k distinct consonants.
28. Implement a function to find the number of substrings where the number of distinct consonants is exactly k.
29. Write a function to find the number of substrings which contain at most k distinct characters.
30. Implement a function to find the number of distinct anagrams of a string.

Beginner Level: View

Advanced Level: View