Write a program as per the following specification: The input to the program is a string. The string may contain substrings ‘not’ and ‘bad’. There are either 0 or 1 occurrences of ‘not’ and ‘bad’. If ‘bad’ comes after ‘not’, then the program outputs a string such that the whole ‘not…bad’ substring in the input is replaced by ‘good’. Otherwise, it prints the original string itself.NOTE: In this question, the input strings for evaluation may or may not contain the substrings ‘not’ and ‘bad’ as substrings. Even if the input contains both, it is not guaranteed that ‘bad’ comes after ‘not’.EXAMPLES:INPUT: The song is good.OUTPUT: The song is good.INPUT: Food is bad? not at all.OUTPUT: Food is bad? not at all.INPUT: The lyrics are not that bad!OUTPUT: The lyrics are good!
Write a program as per the following specification: The input to the program is a string. The string may contain substrings ‘not’ and ‘bad’. There are either 0 or 1 occurrences of ‘not’ and ‘bad’. If ‘bad’ comes after ‘not’, then the program outputs a string such that the whole ‘not…bad’ substring in the input is replaced by ‘good’. Otherwise, it prints the original string itself.NOTE: In this question, the input strings for evaluation may or may not contain the substrings ‘not’ and ‘bad’ as substrings. Even if the input contains both, it is not guaranteed that ‘bad’ comes after ‘not’.EXAMPLES:INPUT: The song is good.OUTPUT: The song is good.INPUT: Food is bad? not at all.OUTPUT: Food is bad? not at all.INPUT: The lyrics are not that bad!OUTPUT: The lyrics are good!
