Question 50 (Java)

A professor wants to see if two students have cheated when writing a paper. Design a function : hasCheated(String s1,String s2, int N) that evaluates to true if two strings have a common substring of length N. Additional question after implementation. Assume you don’t have the possibility of using String.contains() and String.substring(). How would you implement this?1. A professor wants to see if two students have cheated when writing a paper. Design a function : hasCheated(String s1,String s2, int N) that evaluates to true if two strings have a common substring of length N. Additional question after implementation. Assume you don’t have the possibility of using String.contains() and String.substring(). How would you implement this?

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

KodNest Training New Batch is starting on 5th October 2020. Attend one week free demo classes.Register Now

New Report

Close