当前位置:网站首页>2022.7.28-----leetcode.1331
2022.7.28-----leetcode.1331
2022-07-29 01:24:00 【路Lu727】
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;
}
边栏推荐
- mobile-picker.js
- Golang startup error [resolved]
- Sharpness evaluation method without reference image
- What is a proxy server? [2022 guide]
- Jetpack--了解ViewModel和LiveData的使用
- [MySQL] SQL aliases the table
- Probability Density Reweight
- 关于字符串处理的相关函数记录(长期更新)
- h5背景音乐通过触摸自动播放
- Force deduction brush question (1): sum of two numbers
猜你喜欢

(CVPR-2019)选择性的内核网络

【流放之路-第二章】

MySQL high performance optimization notes (including 578 pages of notes PDF document), collected

Dynamic memory and smart pointer

(cvpr-2019) selective kernel network

Flexible layout single selection
![[the road of Exile - Chapter 6]](/img/cd/408118f43dbda2e6367b328a1c20fc.png)
[the road of Exile - Chapter 6]

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

Overview of Qualcomm 5g intelligent platform

What is browser fingerprint recognition
随机推荐
[golang] synchronization lock mutex
Probability Density Reweight
Mathematical modeling -- heat conduction of subgrade on Permafrost
控制输入框弹出弹窗 和不弹出窗口
Leetcode/0 and 1 consecutive subarrays with the same number
Leetcode/ and continuous shortest subarray greater than or equal to target
Jetpack--了解ViewModel和LiveData的使用
JVM内存溢出在线分析Dump文件以及在线分析打开.hprof文件得出JVM运行报告jvisualvm怎么在线分析
Implementation of 10m multifunctional signal generator with FPGA
忽略微信设置字体
[the road of Exile - Chapter 4]
[the road of Exile - Chapter 6]
Thirty years of MPEG audio coding
Probability Density Reweight
Mathematical modeling -- red wine quality classification
Explanation of yocto project directory structure
h5背景音乐通过触摸自动播放
mobile-picker.js
Control the pop-up window and no pop-up window of the input box
leetcode/0和1个数相同的连续子数组