Description
https://leetcode.com/problems/plus-one-linked-list/
Solution
1 | /** |
Why don't you come to your senses?
https://leetcode.com/problems/plus-one-linked-list/
1 | /** |
Given a node from a cyclic linked list which is sorted in ascending order, write a function to insert a value into the list such that it remains a cyclic sorted list. The given node can be a reference to any single node in the list, and may not be necessarily the smallest value in the cyclic list.
If there are multiple suitable places for insertion, you may choose any place to insert the new value. After the insertion, the cyclic list should remain sorted.
If the list is empty (i.e., given node is null
), you should create a new single cyclic list and return the reference to that single node. Otherwise, you should return the original given node.
1 | /* |
Given a list of words and two words word1 and word2, return the shortest distance between these two words in the list.
Example:
Assume that words = ["practice", "makes", "perfect", "coding", "makes"]
.
1 | Input: word1 = “coding”, word2 = “practice” |
Note:
You may assume that word1 does not equal to word2, and word1 and word2 are both in the list.
1 | class Solution { |
Given an array of n integers nums and a target, find the number of index triplets i, j, k
with 0 <= i < j < k < n
that satisfy the condition nums[i] + nums[j] + nums[k] < target
.
Example:
1 | Input: nums = [-2,0,1,3], and target = 2 |
1 | class Solution { |
Numbers can be regarded as product of its factors. For example,
1 | 8 = 2 x 2 x 2; |
Write a function that takes an integer n and return all possible combinations of its factors.
Note:
Example 1:
1 | Input: 1 |
Example 2:
1 | Input: 37 |
Example 3:
1 | Input: 12 |
Example 4:
1 | Input: 32 |
1 | class Solution { |
1 | class Solution { |
3 4 5
1 | class Solution { |
https://leetcode.com/problems/01-matrix/description/
1 | class Solution { |
https://leetcode.com/problems/minesweeper/description/
1 | class Solution { |
https://leetcode.com/problems/find-bottom-left-tree-value/description/
1 | /** |
https://leetcode.com/problems/same-tree/
1 | /** |