For this Question: For a given string S and a pattern P, your task is to print all the indexes where the pattern occur in the given string S.First line of input contains the string P, the next line of input contains the string S.

Constraints:-
1 <= |S| <= 500000
1 <= |P| <= 100000

Note:- String will contain only lowercase English lettersPrint all the indexes in ascending order separated by spaces where the pattern occurs in the string S. if none indexes are present then print -1.Sample Input:-
na
banana

Sample Output:-
2 4

Sample Input:-
Newton
School

Sample Output:-
-1, I have written this Solution Code: import java.io.*;
import java.util.*;



class Main {
	public static void main (String[] args) {

                      Scanner sc = new Scanner(System.in);
                      String a = sc.next();
                      String b = sc.next();
                      int alen = a.length();
                      int blen = b.length();
                      int len=0;

                      if(alen>blen)
                      System.out.println("-1");
                      else {
                          StringBuilder sb = new StringBuilder("");
                          boolean flag = false;
                          int s=0;

                          while(true){
                              int value = b.indexOf(a,s);
                              if(value!=-1)
                              {

                                sb.append(b.indexOf(a,s)).append(" ");
                                 s=value+1;
                                flag=true;
                              }else {
                                  break;
                              }
                      }
                          if(flag)
                          System.out.println(sb);
                          else
                          System.out.println("-1");
                      }

	}
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?