Substring Same sequence

Given a String and substing, check whether the character in substring are present in the main string in the SAME SEQUENCE. If yes, return true. Input 1: String: "Hello" Substring: "elo" Output: true Input 2: String: "hi friends" Substring: "hiiids" Output: false public class Answer implements SubStringSameSequenceInterface { @Override public boolean SubStringSameSequence(String str, String subStr) { // WRITE YOUR CODE HERE return ; } public static void main(String [] args) { // write code here to test } }

Answer

No comments:

Post a Comment