当前位置:网站首页>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;
}
边栏推荐
- Probability Density Reweight
- Establish an engineering template based on STM32 in keil -- detailed steps
- Verilog procedure assignment statements: blocking & non blocking
- Planning mathematics final simulation exam I
- Solution of Lenovo notebook camera unable to open
- Mathematical modeling -- the laying of water pipes
- [circuit design] convert AC AC to DC
- druid. io index_ Realtime real-time query
- 数学建模——派出所选址
- Semiconductor chip industry chain
猜你喜欢

Process -- user address space and kernel address space
![[云原生]微服务架构是什么](/img/84/a0ec68646083f3539aa39ad9d98749.png)
[云原生]微服务架构是什么

LM13丨形态量化-动量周期分析

Type analysis of demultiplexer (demultiplexer)

Day01 job

Try to understand the essence of low code platform design from another angle
![[golang] use select {}](/img/30/fa593ec682a40c47689c1fd88f9b83.png)
[golang] use select {}

What is browser fingerprint recognition

(arxiv-2018) reexamine the time modeling of person Reid based on video
![[circuit design] convert AC AC to DC](/img/b4/67df7f4555379c63694e89055499bb.jpg)
[circuit design] convert AC AC to DC
随机推荐
[the road of Exile - Chapter III]
Planning mathematics final exam simulation II
[the road of Exile - Chapter 7]
Form verification hidden input box is displayed before verification
druid. IO custom real-time task scheduling policy
[electronic components] constant voltage, amplify the current of the load (triode knowledge summary)
h5背景音乐通过触摸自动播放
How companies make business decisions -- with the help of data-driven marketing
ASCII code table
表单校验 隐藏的输入框 显示才校验
[the road of Exile - Chapter 6]
Process -- user address space and kernel address space
Lua third-party byte stream serialization and deserialization module --lpack
数学建模——自来水管道铺设问题
数学建模——公交调度优化
Promise solves asynchrony
Why does stonedb dare to call it the only open source MySQL native HTAP database in the industry?
【流放之路-第三章】
Overview of Qualcomm 5g intelligent platform
【ONE·Data || 链式二叉树】