hihoCoder 1552-缺失的拼图

hihoCoder 1552-缺失的拼图

输出

5
0 0 4 5
0 0 3 1
0 1 2 5
3 0 4 5
2 2 3 5

2 1 3 2

hihoCoder 1551-合并子目录

hihoCoder 1551-合并子目录

输出

3
/hihocoder/offer22/solutions/p1
/hihocoder/challenge30/p1/test
/game/moba/dota2/uninstall

8

hihoCoder 1550-顺序三元组

hihoCoder 1550-顺序三元组

输出

6
1 3 2 1 2 3

3

LeetCode Find K Closest Elements

LeetCode Find K Closest Elements Given a sorted array, two integers k and x, find the k closest elements to x in the array. The result should also be sorted in ascending order. If there is a tie, the smaller elements are always preferred. Example 1:

Input: [1,2,3,4,5], k=4, x=3
Output: [1,2,3,4]

Example 2:
Input: [1,2,3,4,5], k=4, x=-1
Output: [1,2,3,4]

Note:
1. The value k is positive and will always be smaller than the length of the sorted array.
2. Length of the given array is positive and will not exceed 104
3. Absolute value of elements in the array and x will not exceed 104

LeetCode Judge Route Circle

LeetCode Judge Route Circle Initially, there is a Robot at position (0, 0). Given a sequence of its moves, judge if this robot makes a circle, which means it moves back to the original place. The move sequence is represented by a string. And each move is represent by a character. The valid robot moves are R (Right), L (Left), U (Up) and D (down). The output should be true or false representing whether the robot makes a circle. Example 1:

Input: "UD"
Output: true

Example 2:
Input: "LL"
Output: false