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
- Generating Lyndon words of length n
- K length words that can be formed from given characters without repetition
- Python | Extract odd length words in String
- Python program to print even length words in a string
- Java 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
- Subarray with difference between maximum and minimum element greater than or equal to its length
- Count number of binary strings such that there is no substring of length greater than or equal to 3 with all 1's
- Check if the given string of words can be formed from words present in the dictionary
- Python - Find Words with both alphabets and numbers
- Find the k most frequent words from data set in Python
- Python | Find k longest words in given list
- Python program to find uncommon words from two Strings
- Find alphabetical order such that words can be considered sorted
- Find the size of largest subset of anagram words
- Length of the largest substring which have character with frequency greater than or equal to half of the substring
- Count words that appear exactly two times in an array of 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