A string is given and you have to find all the words (substrings separated by a space) which are greater than given length k.
Input : str = "hello geeks for geeks is computer science portal" k = 4 Output : hello geeks geeks computer science portal Explanation : The output is list of all words that are of length more than k. Input : str = "string is fun in python" k = 3 Output : string python
The idea is to first split given string around space. Then traverse through all words. For every word, check
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Find words which are greater than given length k using stringstream
- Count the number of words having sum of ASCII values less than and greater than k
- Length of the largest substring which have character with frequency greater than or equal to half of the substring
- Check if the given string of words can be formed from words present in the dictionary
- Length of Smallest subarray in range 1 to N with sum greater than a given value
- Count of alphabets having ASCII value less than and greater than k
- Count words that appear exactly two times in an array of words
- Smallest number greater than X which is K-periodic
- Smallest Greater (than S) String of length K whose letters are subset of S
- Count number of binary strings such that there is no substring of length greater than or equal to 3 with all 1's
- Subarray with difference between maximum and minimum element greater than or equal to its length
- Find the starting indices of the substrings in string (S) which is made by concatenating all words from a list(L)
- K length words that can be formed from given characters without repetition
- Maximum length L such that the sum of all subarrays of length L is less than K
- Find Largest Special Prime which is less than or equal to a given number
- Find a string such that every character is lexicographically greater than its immediate next character
- Smallest alphabet greater than a given character
- Python | Select dictionary with condition given key greater than k
- Python program to print even length words in a string
- Generating Lyndon words of length n
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.
Improved By : manishshaw1