<gouthampradhan>array_RevealCardsInIncreasingOrder_1.java
public int[] deckRevealedIncreasing(int[] deck) {
    Arrays.sort(deck);
    ArrayDeque<Integer> queue = new ArrayDeque<>();
    for (int i = deck.length - 1; i >= 0; i--) {
      queue.offer(deck[i]);
      if (i == 0) break;
      int temp = queue.pollFirst();
      queue.offer(temp);
    }
    int[] answer = new int[deck.length];
    int i = 0;
    while (!queue.isEmpty()) {
      answer[i++] = queue.pollLast();
    }
    return answer;
  }
public int [ ] sample_funcname ( int [ ] var_0 ) {
  Arrays . sort ( var_0 ) ;
  ArrayDeque < Integer > var_5 = new ArrayDeque < > ( ) ;
  for ( int var_8 = var_0 . length - 1 ;
  var_8 >= 0 ;
  var_8 -- ) {
    var_5 . offer ( var_0 [ var_8 ] ) ;
    if ( var_8 == 0 ) break ;
    int var_12 = var_5 . pollFirst ( ) ;
    var_5 . offer ( var_12 ) ;
  }
  int [ ] var_13 = new int [ var_0 . length ] ;
  int var_8 = 0 ;
  while ( ! var_5 . isEmpty ( ) ) {
    var_13 [ var_8 ++ ] = var_5 . pollLast ( ) ;
  }
  return var_13 ;
}
