当前位置:网站首页>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;
}
边栏推荐
- Leetcode/ and continuous shortest subarray greater than or equal to target
- Random talk on distributed development
- (arxiv-2018) 重新审视基于视频的 Person ReID 的时间建模
- 点击按钮,下滑到指定的位置
- Process -- user address space and kernel address space
- druid. The performance of IO + tranquility real-time tasks is summarized with the help of 2020 double 11
- 【流放之路-第二章】
- Force deduction brush question (1): sum of two numbers
- The solution of reducing the sharpness of pictures after inserting into word documents
- Mathematical modeling -- the laying of water pipes
猜你喜欢

Basic working principle and LTSpice simulation of 6T SRAM
![Golang startup error [resolved]](/img/9c/c4757c73d4acd8edf22afa8107fb66.png)
Golang startup error [resolved]

(cvpr-2019) selective kernel network

Solution of Lenovo notebook camera unable to open

基于 ICA 与 DL 的语音信号盲分离
![[the road of Exile - Chapter 5]](/img/ef/7ecc1cb4a95c613f7be91f7acc761c.png)
[the road of Exile - Chapter 5]

Understand the clock tree in STM32 in simple terms

MySQL安装常见报错处理大全

Stonedb invites you to participate in the open source community monthly meeting!

Leetcode exercise - Sword finger offer 45. arrange the array into the smallest number
随机推荐
数学建模——自来水管道铺设问题
leetcode/和大于等于target的连续最短子数组
Mobile communication -- simulation model of error control system based on convolutional code
Sigma-DSP-OUTPUT
Dynamic memory and smart pointer
[golang] synchronization lock mutex
How companies make business decisions -- with the help of data-driven marketing
Lua third-party byte stream serialization and deserialization module --lpack
Navigation--实现Fragment之间数据传递和数据共享
Have you ever encountered the situation that the IP is blocked when crawling web pages?
(arxiv-2018) 重新审视基于视频的 Person ReID 的时间建模
[the road of Exile - Chapter 2]
MySQL安装常见报错处理大全
Mathematical modeling -- heat conduction of subgrade on Permafrost
Basic working principle and LTSpice simulation of 6T SRAM
As long as I run fast enough, it won't catch me. How does a high school student achieve a 70% salary increase under the epidemic?
The basic concept of transaction and the implementation principle of MySQL transaction
[MySQL] SQL aliases the table
Random talk on distributed development
[the road of Exile - Chapter 5]