当前位置:网站首页>Force deduction ----- how many numbers are smaller than the current number
Force deduction ----- how many numbers are smaller than the current number
2022-07-21 10:53:00 【qq_ thirty-seven million seven hundred and sixty thousand seven】
/** * Note: The returned array must be malloced, assume caller calls free(). */
int* smallerNumbersThanCurrent(int* nums, int numsSize, int* returnSize){
int* ans=(int*)calloc(numsSize,sizeof(int));
*returnSize=0;
for(int a=0;a<numsSize;a++){
int count=0;
for(int b=0;b<numsSize;b++){
if(nums[a]>nums[b]){
count++;
}
}
ans[*returnSize]=count;
*returnSize=*returnSize+1;
}
return ans;
}
边栏推荐
- 什么是Pygame
- Pandoc installation, use and quick start
- NVIDIA Inspector 详细使用说明书
- bug汇总
- .net Redis客户端NewLife.Redis.Core库的使用
- MySQL remote connection in docker
- C语言程序环境和预处理
- Prometheus Operator 配置报警
- 【延期公告】2022年触觉与虚拟现实国际会议(ICHVR 2022)
- Summary of random number methods generated by MATLAB (reference for each distribution map)
猜你喜欢
宏创建内联函数读写cpu reg
链表(五)——删除链表的倒数第N个节点
Generate arbitrary edge smooth shape (patch) artifact
机器学习—支持向量机理论详细推导(含例题讲解)(四)
[bug solution] warning: grad and param do not obey the gradient layout contract This is not an error, but..
grafana - influxdb可视化 k6 输出
Xilinx MIPI CSI-2 Receiver Subsystem IP详解
filask文件上传下载
[bug resolution] visibledeprecationwarning: creating an ndarray from ragged needed sequences
北森招股书:赛道优势凸显,一体化+中大客户是加分项
随机推荐
Xilinx Mipi csi-2 receiver subsystem IP details
什么是Pygame
Don't know a little statistics, "Star Wars" for nothing
一、MFC介绍
业务出海,灵感乍现前要先「把手弄脏」
codeforces round #805 ABCDEFG
class, classloder, dex 详解
Quick reading of the paper: axial deeplab: stand alone axial attention for panoramic segmentation
关于字符串的分割问题
3.压力测试
Linked list (V) -- delete the penultimate node of the linked list
IBM MQ运维使用手册
Xperia XZ (F8332) 刷机和ROOT过程中遇到的一些问题的解答
Error reporting after matlab 2021b installation activation: solution to license manager error -103
【英雄哥七月集训】第 20天:搜索二叉树
CSDN meetup review - from data lake to index middle stage, improve data analysis ROI
Two methods of generating random integers
在Win Server 2012 R2 下安装 卡巴斯基2018
redis 内存分析工具 RMA 使用
TMECH发表优必选运控技术最新进展:实现人形机器人高鲁棒性行走