using System.Collections.Generic;
public Person(int height, int inFronts)
this.inFronts = inFronts;
public static int[] actualHeightSort(int[] heights, int[] inFronts)
Person top = new Person(heights[0], inFronts[0]);
for(int i = 1; i < heights.Length; i++)
Person newPerson = new Person(heights[i], inFronts[i]);
if(newPerson.height <= top.height)
while(sortStack.Count < heights.Length )
public static void Main()
int[] heights = {5, 3, 2, 6, 1 ,4};
int[] inFronts = {0, 1, 2, 0, 3, 2};
int[] result = actualHeightSort(heights, inFronts);
for(int i = 0; i < result.Length; i++)
Console.Write(result[i] +", ");