package hackerrank;

import java.util.Scanner;

/**
 * https://www.hackerrank.com/challenges/almost-sorted
 */
public class AlmostSorted {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // TODO
    }
}

package hackerrank;

import java.util.Scanner;

/**
 * https://www.hackerrank.com/challenges/almost-sorted
 */
public class AlmostSorted {
    private static void almostSorted(int[] array) {
        // TODO
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[] array = new int[n];
        almostSorted(array);
    }
}

Update Almost Sorted