public static void main(String args[]) {
        RearrangeArrayPerIndex rai = new RearrangeArrayPerIndex();
        int input[] = {1, 2, 0, 5, 3, 4};
        rai.rearrange(input);
        Arrays.stream(input).forEach(i -> System.out.print(i + " "));
    }
Date 12/30/2015

Given an array of size n where elements are in range 0 to n-1. Rearrange elements of array
such that if arr[i] = j then arr[j] becomes i.

Time complexity O(n)
Space complexity O(1)

http://www.geeksforgeeks.org/rearrange-array-arrj-becomes-arri-j/
src/com/interview/array/RearrangeArrayPerIndex.java