当前位置:网站首页>1051. 高度检查器
1051. 高度检查器
2022-06-13 11:14:00 【anieoo】
原题链接:1051. 高度检查器

solution:
排序+比较
class Solution {
public:
int heightChecker(vector<int>& heights) {
vector<int> exp = heights;
sort(exp.begin(),exp.end());
int res = 0;
for(int i = 0;i < exp.size();i++) {
if(exp[i] != heights[i]) res++;
}
return res;
}
};边栏推荐
- Database system concept (Chapter 17)
- Prim finding minimum spanning tree (naive dense graph)
- Apache APISIX v2.14.1 探索性版本发布,进军更多领域
- ue5 小知识点 random point in Bounding Boxf From Stream
- Nim game ladder Nim game and SG function application (set game)
- 宝塔中navicat连接mysql
- C file package and download
- 第七章 文件管理作业
- COM的模式变化引起的IPdu Handling【接收截止日期监控】
- Prim求最小生成树(朴素版稠密图)
猜你喜欢
随机推荐
容斥原理(能被整除的数)
Inclusion exclusion principle (number divisible)
Performance monster on arm64: installation and performance test of API gateway Apache APIs IX on AWS graviton3
2021ccpc online competition list
There is no suspense about the first one in the overtime table of the Internet company!
【TcaplusDB知识库】Tmonitor后台一键安装介绍(二)
宝塔访问从IP改为域名
2021CCPC网络赛题解加总结
pyepics下载和安装
[tcapulusdb knowledge base] tcapulusdb doc acceptance - Introduction to creating game area
The leader said he would go online tomorrow, but he didn't know the development process at all
【TcaplusDB知识库】TcaplusDB单据受理-创建业务介绍
Do you agree that the salary of hardware engineers is falsely high?
We spent a weekend migrating 3.7 million lines of code to typescript
[tcapulusdb knowledge base] Introduction to tmonitor stand-alone installation guidelines (I)
Interview skills Q & A
【TcaplusDB知识库】TcaplusDB单据受理-建表审批介绍
求组合数四种方法
程序员面试这么重视考察概念还是第一次见
[tcapulusdb knowledge base] Introduction to new models of tcapulusdb








