title: Code to tell whether a string is a Pangram or not?
body: <pre><code>import java.io.*;
  import java.util.*;
  
  
  public class Solution {
  
      public static final int n = 26; 
  
      public int check(String arr) {
          if (arr.length() &lt; n) {
             return -1;
          }
          for (char c = 'A'; c &lt;= 'Z'; c++) {
              if ((arr.indexOf(c) &lt; 0) &amp;&amp; (arr.indexOf((char)(c + 32)) &lt; 0)) {
                 return -1;
              }
          }
          return 1;
      }  
  }
  
  public static void main(String[] args) {
      Scanner s1 = new Scanner(System.in);
      String s = s1.next();
      Solution obj = new Solution();
  
      int d = obj.check(s);
  
      if (d == -1) {
          System.out.print("not pangram");
      } else {
          System.out.print("pangram");
      }
  }
  </code></pre>
  
  <p>If the string entered is:<br>
  <em>We promptly judged antique ivory buckles for the next prize</em></p>
  
  <p>It will give the <strong>wrong</strong> output:<br>
  <strong>not pangram</strong>.  </p>
  
  <p>I'm not able to find out what wrong with the code.<br>
  Thanks in advance!    </p>