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
- 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
- Generating Lyndon words of length n
- K length words that can be formed from given characters without repetition
- Python program to print even length words in a string
- Length of Smallest subarray in range 1 to N with sum greater than a given value
- 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
- 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
- Find the k most frequent words from data set in Python
- Python | Find k longest words in given list
- Find alphabetical order such that words can be considered sorted
- Find the size of largest subset of anagram words
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