COMMON PREFIX Two strings s1, s2 are passed as a parameter to the given function. Return the largest common prefix of the strings sl and s2. string commonPrefix(string s1, string s2){ / write your CPP code here

Question
100%
COMMON PREFIX
Two strings s1, s2 are passed as a parameter to the given function. Return the largest common prefix of the strings sl and s2.
string commonPrefix(string s1, string s2){
// write your CPP code here
}
Transcribed Image Text:COMMON PREFIX Two strings s1, s2 are passed as a parameter to the given function. Return the largest common prefix of the strings sl and s2. string commonPrefix(string s1, string s2){ // write your CPP code here }
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer