【leetcode】数组序号转换
2021-03-28 03:25
标签:orm span star for amp int def 数组 important 【leetcode】数组序号转换 标签:orm span star for amp int def 数组 important 原文地址:https://www.cnblogs.com/ganxiang/p/13645847.htmltypedef struct{
int val;
int index;
}st;
int cmp(const void* a, const void* b){
return ((st*)a)->val - ((st*)b)->val;
}
int* arrayRankTransform(int* arr, int arrSize, int* returnSize){
st* stArr = (st*)calloc(arrSize,sizeof(st));
int i,j=1;
for (i=0; i