当前位置:网站首页>2022.7.28-----leetcode.1331
2022.7.28-----leetcode.1331
2022-07-29 02:12:00 【Lu 727】
public int[] arrayRankTransform(int[] arr) {
int[] clone = arr.clone();
Arrays.sort(clone);
Map<Integer, Integer> map = new HashMap<>();
int n = arr.length, idx = 0;
for (int i : clone) {
if (!map.containsKey(i)) map.put(i, ++idx);
}
int[] ans = new int[n];
for (int i = 0; i < n; i++) ans[i] = map.get(arr[i]);
return ans;
}
边栏推荐
- Have you ever encountered the situation that the IP is blocked when crawling web pages?
- Secret skill winter tide branding skill matching
- How to write, load and unload plug-ins in QT
- Monadic linear function perceptron: Rosenblatt perceptron
- Stonedb invites you to participate in the open source community monthly meeting!
- How to crawl web pages with playwright?
- Random talk on distributed development
- leetcode 242. Valid Anagram(有效的字母异位词)
- The number of consecutive subarrays whose leetcode/ product is less than k
- Mathematical modeling - location of police stations
猜你喜欢

(arxiv-2018) 重新审视基于视频的 Person ReID 的时间建模

JS dom2 and dom3

Why can't Bi software do correlation analysis

试着换个角度理解低代码平台设计的本质

The solution of reducing the sharpness of pictures after inserting into word documents

弹性布局 单选

druid. The performance of IO + tranquility real-time tasks is summarized with the help of 2020 double 11
![[the road of Exile - Chapter 5]](/img/ef/7ecc1cb4a95c613f7be91f7acc761c.png)
[the road of Exile - Chapter 5]

Ciscn 2022 central China Misc

【ONE·Data || 链式二叉树】
随机推荐
[circuit design] convert AC AC to DC
控制输入框弹出弹窗 和不弹出窗口
Mathematical modeling - location of police stations
LM13丨形态量化-动量周期分析
Nine days later, we are together to focus on the new development of audio and video and mystery technology
MySQL high performance optimization notes (including 578 pages of notes PDF document), collected
[the road of Exile - Chapter 6]
【ONE·Data || 链式二叉树】
Opencv image sharpness evaluation (camera autofocus)
leetcode/0和1个数相同的连续子数组
Blind separation of speech signals based on ICA and DL
Mathematical modeling -- the laying of water pipes
Understand the working principle of timer in STM32 in simple terms
Mobile communication -- simulation model of error control system based on convolutional code
Anti crawler mechanism solution: JS code generates random strings locally
2022.7.28-----leetcode.1331
How to write, load and unload plug-ins in QT
数学建模——红酒品质分类
点击回到顶部js
Qt源码分析--QObject(4)