title: Decrypt a Java string
body: <p>I'm trying to make a program in java that's decrypting a text.</p>
  <p>Example:</p>
  <p>Input: ABKBFA</p>
  <p>Output: ABBA</p>
  <p>Rules:</p>
  <blockquote>
  <ul>
  <li><p>Keep the first letter and the last letter</p>
  </li>
  <li><p>Jump over some letters dependence of alphabet (A-Z), The Alphabet has values  A=1 B=2 C=3... So if the word is &quot;HZBKRYAFEAAAAJ&quot; it will first keep the letter H, and because H=8, it will jump 8 steps and land on E. When it lands on E, the word is HE, but it is not finished. E=5, so 5 steps to jump and it lands on J, and the word will be &quot;HEJ&quot;.</p>
  </li>
  </ul>
  </blockquote>
  <p>I have not come as far to know how to solve this problem. Right now it only saves the last and the first.</p>
  <pre><code>    public static void main(String[] args) {
      
         Scanner sc = new Scanner(System.in);
         String text = sc.nextLine();
         char[] alphabet = {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
         char firstLetter = 0;
         char lastLetter = (char) (text.length()-1);
  
            System.out.println(text.charAt(firstLetter)+&quot;&quot;+text.charAt(lastLetter));
  
  
  }
  </code></pre>