Question: In this question you are going to write a method named longest which takes two string parameters and returns the longest common ending between the
In this question you are going to write a method named longest which
takes two string parameters and returns the longest common ending between
the two strings. You are not allowed to use String methods except length
and charAt. You may use the reverse method you have written in part a). Some
example outputs are given below.
longest("eight","straight) returns "ight"
longest("network","dark") returns "rk"
longest("hello","world") returns ""
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
