Question 8

You have been given a string and a number. You need to find the longest common suffix between string and substring(0 to number)

Example : String = “ababa”

Number is 3

Take a substring from 0 to 2 which is aba

now find the longest matching suffix between “ababa” and “aba”.

[advanced_iframe securitykey=”undefined” src=”https://code.kodnest.com/” width=”100%” height=”600″]

KodNest Training New Batch is starting on 02nd November 2020. Attend one week free demo classes.Register Now

New Report

Close