(Common prefix) Write a method that returns the common prefix of two strings. For example, the common prefix of "distance" and "disinfection" is "dis". The header of the method is as follows:
public static String prefix(String s1, String s2)
if the two strings have no common prefix, the method returns an empty string.
Write a main method that prompts the user to enter two strings and display their common prefix.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.