You are viewing a single comment's thread. Return to all comments →
Bro it's my solution only loop,no array:
import java.io.; import java.util.;
public class Solution {
public static boolean MyCheck(char c,String s1){ for(int i=0; i<s1.length() ; i++){ if(s1.charAt(i)==c) return false; } return true ; } public static void main(String[] args) { /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ Scanner scan=new Scanner(System.in) ; String s=scan.nextLine(); int l=s.length(); s=s.toUpperCase(); int len=0,total=2015; String newStr=" "; for(int i=0 ; i<l ; i++){ char word=s.charAt(i) ; int n=word ; if((n>=65 || n<=90) && n!=32 && MyCheck(word,newStr) ){ newStr+=word ; len++; total=total-n ; } } if(total==0 && len==26) System.out.println("pangram"); else System.out.println("not pangram"); }
}
Seems like cookies are disabled on this browser, please enable them to open this website
Pangrams
You are viewing a single comment's thread. Return to all comments →
Bro it's my solution only loop,no array:
import java.io.; import java.util.;
public class Solution {
}