Question: In java please Write an efficient method that takes a string txt and an integer M as arguments and returns the position of the first

In java please
Write an efficient method that takes a string txt and an integer M as arguments and returns the position of the first occurrence of M consecutive blanks in the string. If there is no such occurrence it should return the length of txt (txt.length). Give a runtime analysis of the method. 4
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
