Skip to main content
491, Non-decreasing Subsequences

I Problem

Given an integer array nums, return all the different possible non-decreasing subsequences of the given array with at least two elements. You may return the answer in any order.

Example 1
Input: nums = [4, 6, 7, 7]
Output: [[4, 6], [4, 6, 7], [4, 6, 7, 7], [4, 7], [4, 7, 7], [6, 7], [6, 7, 7], [7, 7]]


MikeAbout 1 minbacktrackingmediumarrayhash tablebit manipulationbacktracking
90, Subsets II

I Problem

Given an integer array nums that may contain duplicates, return all possible subsets (the power set).

The solution set must not contain duplicate subsets. Return the solution in any order.

Example 1
Input: nums = [1, 2, 2]
Output: [[], [1], [1, 2], [1, 2, 2], [2], [2, 2]]


MikeAbout 1 minbacktrackingmediumarraybacktrackingbit manipulation
78, Subsets

I Problem

Given an integer array nums of unique elements, return all possible subsets (the power set).

The solution set must not contain duplicate subsets. Return the solution in any order.

Example 1
Input: nums = [1, 2, 3]
Output: [[], [1], [2], [1, 2], [3], [1, 3], [2, 3], [1, 2, 3]]


MikeAbout 1 minbacktrackingmediumarraybacktrackingbit manipulation
222, Count Complete Tree Nodes

I Problem

Given the root of a complete binary tree, return the number of the nodes in the tree.

According to Wikipedia, every level, except possibly the last, is completely filled in a complete binary tree, and all nodes in the last level are as far left as possible. It can have between 1 and nodes inclusive at the last level h.


MikeAbout 3 minbinary treeeasybinary treebit manipulation