title: Need to find difference between two characters(Alphabet is cyclic)
body: <p>Given a string, <code>"azza"</code>. In this <code>a-z = 25</code>, <code>z-z = 0</code>, <code>z-a = 25</code>. But since alphabet is cyclic, I need <code>'a'</code> just after <code>'z'</code> i.e., in the above string <code>z-a = 1</code>.</p>
  
  <p>For normal string where we dont encounter '<code>a</code>' just after '<code>z</code>', my code is this</p>
  
  <pre><code>class TestClass {
      public static void main(String args[] ) throws Exception {
          Scanner sc = new Scanner(System.in);
          int i;
          int t = sc.nextInt();
          sc.nextLine();
  
          for(i=0;i&lt;t;i++)
          {
              String  s =sc.nextLine();
              char[] string =s.toCharArray();
              for(i=0;i&lt;string.length;i++)
              {
                  if((string[i]-string[i+1])==1 || (string[i]-string[i+1])==-1)
                  {
                         System.out.println("1");
                  }                   
              }               
          }
      }
  }
  </code></pre>