title: Circular Array Rotation Hackerrank
body: <p>Here is the Link of the problem which I was solving on Hackerrank:-<a href="https://www.hackerrank.com/challenges/circular-array-rotation/problem" rel="nofollow noreferrer">https://www.hackerrank.com/challenges/circular-array-rotation/problem</a></p>
  
  <p>Here is my code this code passes all the testcases except the fourth test will someone please help me what's wrong here.</p>
  
  <pre><code>public class Solution {
      public static void main(String[] args) {
          try(Scanner in = new Scanner(System.in)) {
              int n = in.nextInt();
              int k = in.nextInt();
              int q = in.nextInt();
              int a[] = new int[n];
  
              for(int i = 0; i &lt; n; i++)
                  a[i] = in.nextInt();
  
              for(int i = 0; i &lt; q; i++) {
                  int m = in.nextInt();
                  System.out.println(a[(n - k + m) % n]);
              }
          }
      }
  </code></pre>
  
  <p>}</p>