-
Notifications
You must be signed in to change notification settings - Fork 0
HarshSDE0/REVERSE-STRING
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
# REVERSE-STRING //{ Driver Code Starts //Initial Template for Java import java.io.*; class GFG{ // } Driver Code Ends //User function Template for Java // function should find if the string p is // in the string s. Return the starting index // of the string p in s. Return -1 if the // string doesnot exists in s. public static int findPattern(String s, String p){ // code here int index =s.indexOf(p); return index; } //{ Driver Code Starts. public static void main(String args[])throws IOException{ BufferedReader read = new BufferedReader( new InputStreamReader(System.in)); int t = Integer.parseInt(read.readLine()); while( t-- > 0){ String s = read.readLine().trim(); String p = read.readLine().trim(); int index = findPattern(s, p); System.out.println(index); } } } // } Driver Code Ends
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published