Lunski's Clutter

This is a place to put my clutters, no matter you like it or not, welcome here.

0%

在健身房聽到不錯的歌,這篇當歌曲翻譯文章的開端應該很適合,MV意境知道這首歌是小男孩表達對父親的思念,想打造火箭追尋爸爸的蹤跡,不斷仰望星空,不斷追尋父愛,尤其是副歌那串斷斷續續的意境表達不斷追尋但找不回來的感受,有種當初聽到爐心融解或看命運石之門的感受(好啦我很宅)總之希望大家會喜歡。

Read more »

Given an array of integers arr, replace each element with its rank.

The rank represents how large the element is. The rank has the following rules:

Rank is an integer starting from 1.
The larger the element, the larger the rank. If two elements are equal, their rank must be the same.
Rank should be as small as possible.

Example 1:

1
2
3
Input: arr = [40,10,20,30]
Output: [4,1,2,3]
Explanation: 40 is the largest element. 10 is the smallest. 20 is the second smallest. 30 is the third smallest.

Example 2:

1
2
3
Input: arr = [100,100,100]
Output: [1,1,1]
Explanation: Same elements share the same rank.

Example 3:

1
2
Input: arr = [37,12,28,9,100,56,80,5,12]
Output: [5,3,4,2,8,6,7,1,3]
Read more »

Given the array nums consisting of 2n elements in the form [x1,x2,…,xn,y1,y2,…,yn].

Return the array in the form [x1,y1,x2,y2,…,xn,yn].

Example 1:

1
2
3
Input: nums = [2,5,1,3,4,7], n = 3
Output: [2,3,5,4,1,7]
Explanation: Since x1=2, x2=5, x3=1, y1=3, y2=4, y3=7 then the answer is [2,3,5,4,1,7].

Example 2:

1
2
Input: nums = [1,2,3,4,4,3,2,1], n = 4
Output: [1,4,2,3,3,2,4,1]

Example 3:

1
2
Input: nums = [1,1,2,2], n = 2
Output: [1,2,1,2]
Read more »