For this Question: Given a string. Find out the distinct alphabets and the number of times they occur.The input contains a single string S.

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

Note:- String will contain only lowercase characters and spaces.Print 26 space separated numbers that denote the number of occurrences of each character from 'a' to 'z'.Sample Input:-
newton school

Sample Output:-
0 0 1 0 1 0 0 1 0 0 0 1 0 2 3 0 0 0 1 1 0 0 1 0 0 0, I have written this Solution Code: import java.io.*;
import java.util.*;
class Main{
    public static void distinctAlphabet(String str){
        int n=str.length();
        int count[]=new int[26];
        for(int i=0; i<n;i++){
            if(str.charAt(i)!=' '){
                count[str.charAt(i)-'a']++;
            }
            else if(str.charAt(i)==' '){
                continue;
            }
        }
        for(int i=0;i<26;i++){
            System.out.print(count[i]+" ");
        }
    }
    public static void main(String args[]){
        Scanner sc=new Scanner(System.in);
        String s=sc.nextLine();
        distinctAlphabet(s);
    }
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?