[LeetCode] Next Permutation (Java)

Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not possible, it must rearrange it as the lowest possible order (ie, sorted in ascending order). The replacement must be in-place, do not allocate extra memory. Here are some examples. Inputs are in the left-hand column and … Read more[LeetCode] Next Permutation (Java)

[LeetCode] Letter Combinations of a Phone Number (Java)

Given a digit string, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the telephone buttons) is given below.

Note: Although the above answer is in lexicographical order, your answer could be in any order you want. Analysis It’s a easy question. But we … Read more[LeetCode] Letter Combinations of a Phone Number (Java)

Create shortcut in Ubuntu

We may install some software manually. For example, we can run the Idea Intellij by running idea.sh. But it’s not so convenient.  So we can create a shortcut for the problem. Create a Idea.desktop file on the desktop. The content is as follow.

You may need to change the paths in the file and … Read moreCreate shortcut in Ubuntu