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
- Smallest Greater (than S) String of length K whose letters are subset of S
- 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
- Python | Find k longest words in given list
- Find the k most frequent words from data set in Python
- Find the size of largest subset of anagram words
- Find alphabetical order such that words can be considered sorted
- Python program to find uncommon words from two Strings
- Count words that appear exactly two times in an array of words
- Find the starting indices of the substrings in string (S) which is made by concatenating all words from a list(L)
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. 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