HACKERRANK :-SPLIT ARRAY EXAMPLE

import java.io.*;
class split
{
    public static void main(String args[])throws IOException
    {
        InputStreamReader isr=new InputStreamReader(System.in);
        BufferedReader br=new BufferedReader(isr);
         System.out.println("Yes");
        String s1=br.readLine();
        String s2=br.readLine();
        String ar[]=s2.split(" ");
        int a=Integer.parseInt(ar[0]);
        int b=Integer.parseInt(ar[1]);
        String ss1=s1.substring(a,b);
        System.out.println(ss1);
    }
}

Comments

Popular Posts