Lunski's Clutter

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

0%

Given an array of strings strs, group the anagrams together. You can return the answer in any order.

An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once.

Read more »

You are given an n x n 2D matrix representing an image, rotate the image by 90 degrees (clockwise).

You have to rotate the image in-place, which means you have to modify the input 2D matrix directly. DO NOT allocate another 2D matrix and do the rotation.

Example 1:

1
2
Input: matrix = [[1,2,3],[4,5,6],[7,8,9]]
Output: [[7,4,1],[8,5,2],[9,6,3]]

Example 2:

1
2
Input: matrix = [[5,1,9,11],[2,4,8,10],[13,3,6,7],[15,14,12,16]]
Output: [[15,13,2,5],[14,3,4,1],[12,6,8,9],[16,7,10,11]]

Example 3:

1
2
Input: matrix = [[1]]
Output: [[1]]

Example 4:

1
2
Input: matrix = [[1,2],[3,4]]
Output: [[3,1],[4,2]]
Read more »

Given an array of distinct integers candidates and a target integer target, return a list of all unique combinations of candidates where the chosen numbers sum to target. You may return the combinations in any order.

The same number may be chosen from candidates an unlimited number of times. Two combinations are unique if the frequency of at least one of the chosen numbers is different.

It is guaranteed that the number of unique combinations that sum up to target is less than 150 combinations for the given input.

Example 1:

1
2
3
4
5
6
Input: candidates = [2,3,6,7], target = 7
Output: [[2,2,3],[7]]
Explanation:
2 and 3 are candidates, and 2 + 2 + 3 = 7. Note that 2 can be used multiple times.
7 is a candidate, and 7 = 7.
These are the only two combinations.

Example 2:

1
2
Input: candidates = [2,3,5], target = 8
Output: [[2,2,2,2],[2,3,3],[3,5]]

Example 3:

1
2
Input: candidates = [2], target = 1
Output: []

Example 4:

1
2
Input: candidates = [1], target = 1
Output: [[1]]

Example 5:

1
2
Input: candidates = [1], target = 2
Output: [[1,1]]
Read more »

偶然聽到這首歌,跟介紹過的每首都有感動的感覺,決定好好研究一下,下週我生日會停刊一週,也先祝Shvara生日快樂。

Read more »

Documents tell us before we write documents, we must state our purpose. Who should read those documents, don’t waste the reader’s time.

Punctuation tells us that we need to choose the right sign. if two sentences have a connection, we should use semicolons; if the connection is a sequence, we should use commas; if the second sentence is used to emphasize the first sentence - em-dashes; if the second sentence is minor points (parentheses).

Read more »