import (
"fmt"
)
func findRelativeRanks(nums []int){
index := []int{}
for i := 0; i < len(nums);i++ {
index=append(index,i)
}
// index
// {0,1,2,3,4}
sort.Slice(index, func (i,j int)bool{
return nums[i]<nums[j]
})
fmt.Println(index)
// actually get [1 0 2 4 3], not [1, 4, 2, 3, 0] as expected
// can't use sort.Slice between two slices
}
func main(){
nums := []int{10,3,8,9,4}
findRelativeRanks(nums)
}