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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!