# 若只如初见

0%

## 问题描述

You have a number of envelopes with widths and heights given as a pair of integers (w, h). One envelope can fit into another if and only if both the width and height of one envelope is greater than the width and height of the other envelope.

• Selectors API(选择符 API)
• HTML5

## 问题描述

Given an integer array nums, return the length of the longest strictly increasing subsequence.

A subsequence is a sequence that can be derived from an array by deleting some or no elements without changing the order of the remaining elements. For example, [3,6,2,7] is a subsequence of the array [0,3,1,6,2,2,7].

Example 1:

Example 2:

Example 3:

Constraints:

• 1 <= nums.length <= 2500
• -104 <= nums[i] <= 104

• Could you come up with the O(n2) solution?

• Could you improve it to O(n log(n)) time complexity?

## 问题描述

You are given an integer array nums and you have to return a new counts array. The counts array has the property where counts[i] is the number of smaller elements to the right of nums[i].

## 问题描述

A peak element is an element that is greater than its neighbors.

Given an input array nums, where nums[i] ≠ nums[i+1], find a peak element and return its index.

The array may contain multiple peaks, in that case return the index to any one of the peaks is fine.

You may imagine that nums[-1] = nums[n] = -∞.

## 问题描述

Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.

`(i.e., [0,0,1,2,2,5,6] might become [2,5,6,0,0,1,2]).`

You are given a target value to search. If found in the array return true, otherwise return false.

## 问题描述

Given an unsorted array nums, reorder it such that nums < nums > nums < nums….

Example 1:

## 问题描述

A sequence of numbers is called a wiggle sequence if the differences between successive numbers strictly alternate between positive and negative. The first difference (if one exists) may be either positive or negative. A sequence with fewer than two elements is trivially a wiggle sequence.

## 问题描述

Given an array nums, write a function to move all 0’s to the end of it while maintaining the relative order of the non-zero elements.

Example:

Note:

• You must do this in-place without making a copy of the array.
• Minimize the total number of operations.

## 问题描述

Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.