摘要:
待 阅读全文
摘要:
【题目】 寻找峰值返回坐标,比左右都大,时间复杂度必须是 O(log n) A peak element is an element that is strictly greater than its neighbors. Given an integer array nums, find a pe 阅读全文
摘要:
【题目】 说了一堆就是在旋转后的顺序数组中找最小值,时间复杂度必须是 O(log n) Suppose an array of length n sorted in ascending order is rotated between 1 and n times. For example, the 阅读全文
摘要:
【题目】 两个数组,求他们最长的相同子串长度,数组长度不一定相同 Given two integer arrays nums1 and nums2, return the maximum length of a subarray that appears in both arrays. Exampl 阅读全文
摘要:
【题目】 多次方计算,主要是正负两种情况 Implement pow(x, n), which calculates x raised to the power n (i.e., xn). Example 1: Input: x = 2.00000, n = 10 Output: 1024.0000 阅读全文
摘要:
leetcode33 【题目】 顺序排列的数组,每个点值不同。以某个点进行旋转(其实就是前后两段交换位置),对旋转后数组搜索有无target,没有-1,有返回位置 (变式81不同点在于会出现重复数字) There is an integer array nums sorted in ascendin 阅读全文
摘要:
leetcode74 【题目】 二维矩阵里找目标值target Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: I 阅读全文
摘要:
【题目】 一个版本出错,后续版本皆错,找到第一个出错的版本 You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of yo 阅读全文
摘要:
【题目】 找到两个数组的相同元素并输出。 Given two integer arrays nums1 and nums2, return an array of their intersection. Each element in the result must be unique and yo 阅读全文
摘要:
【题目】 非负的有序数组中,如果有与target相同的,输出该数位置,如果没有,输出应该将target插到哪个位置 Given a sorted array of distinct integers and a target value, return the index if the target 阅读全文