Given a string str and an integer L. The task is to print all the unique substring of length L from string str.
Input: str = “abca”, L=3
Output: “abc”, “bca”
Input: str = “aaaa”, L=3
Firstly genearate all the substring of length L and then by using set we can insert unique sub-string till the length L and then print the result.
Below is the implementation of the above approach:
- Count all Prime Length Palindromic Substrings
- Count number of distinct substrings of a given length
- Convert all substrings of length 'k' from base 'b' to decimal
- Find number of substrings of length k whose sum of ASCII value of characters is divisible by k
- Minimum length of the sub-string whose characters can be used to form a palindrome of length K
- Maximum contiguous 1 possible in a binary string after k rotations
- Contiguous subsegments of a string having distinct subsequent characters
- Distinct state codes that appear in a string as contiguous sub-strings
- Number of substrings of a string
- Count substrings with same first and last characters
- Replace two substrings (of a string) with each other
- Number of substrings divisible by 8 but not by 3
- Count substrings that contain all vowels | SET 2
- Find substrings that contain all vowels
- Count all substrings having character K
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.