Google Telephonic Interview

// Google Telephonic Coding Interview Question ( Software Engineer Bay Area March 2019):
// We need to sort array A, array B contains indices to corresponding elements in array A with their correct sorted location (at cost of O(n) with constant space)

int A[] = {24,56,74,-23,87,91};
int B[] = {2,3,4,1,5,6};

int[] sortAWithB(int A[], intB[]){

}