Menu

[Solved]-Q1 Write Static Member Function Called Removelongestrepeatingsegment Takes String Argument Q37270526

q1)Write a static member function calledremoveLongestRepeatingSegment that takes a String argument. Themethod will return a new String by removing the logest segment thatcontains consequtively repeating characters. public static voidmain(String []args){ String s=”1111222223333311111111444455552222”;String res= removeLongestRepeatingSegment(s); will return“11112222233333444455552222” } public static StringremoveLongestRepeatingSegment(String s){

Expert Answer


Answer to q1)Write a static member function called removeLongestRepeatingSegment that takes a String argument. The method will ret… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *