IRA Unix SBQ
Rajesh is playing a word game and he is stuck at a point. Now your task is to help him in choosing the correct words from a list of words that meet the specific condition provided. Condition: The count of the maximum repeating letter/character in the word should be less than 3 (For more clarity refer to the sample input and output format along with explanation). Write the Unix command that prints the words satisfying the above condition from a given list of words. Input: List of words each separated by a new line. Output: List of words from input list that meet the specific condition. Each word in output list should also be separated by a new line. If no word from the input list satisfies the above condition then print "No word to pick."(Without quotes)hello
Explanation: For the word 'cocolo' the maximum repeating character is "o" and its count is 3 which is not less than 3. Hence it does not meet the specific condition so the word will not be printed in output. For the word 'hello' the maximum repeating character is"" and its count is 2 which is less than 3. Hence it meets the specific condition provided and so the word will be printed in output.
Note: All the searches/matches should be case Insensitive.
Refer to the examples below for more clarity on input and output formats. The file name input will be provided as a command line argument when the script containing your command will run. You can use shell variables (e.g. $0,$1,$2) whichever is applicable for your requirement to provide the command line argument.
Sample Input 1:
responsible
colleague
poison
seasonal
possession
output:
responsible
colleague
poison
seasonal
Sample Input2:
poSSession
poison
Expected Output:
poison
IF YOUR CONFUSED AND DON'T KNOW HOW TO SOLVE THIS QUESTIONS. REFER TO THE BELOW VIDEO.I HAVE GIVEN DETAILED STRUCTURE TO FOLLOW AND EASIEST WAY TO SOLVE THIS QUESTION.
HOPE THIS IS HELPFUL TO YOU GUYS.IF YOU LIKE MY WORK ,CONSIDER SUBSCRIBING TO MY CHANNEL AND FOLLOW MY BLOGPOST FOR MORE UPDATES.
0 Comentarios