Leetcode 230. Kth Smallest Element in a BST

Given a binary search tree, write a function kthSmallest to find the kth smallest element in it.求一个二叉搜索树的第k小值。题目链接:https://leetcode.com/problems/kth-s...

LeetCode 169. 多数元素 Majority Element

LeetCode 169. 多数元素 Majority ElementTable of Contents一、中文版二、英文版三、My answer四、解题报告一、中文版给定一个大小为 n 的数组,找到其中的多数元素。多数元素是指在数组中出现次数大于 ⌊ n/2 ⌋ 的元素。你可以...

LeetCode 229. Majority Element II

LeetCode 229. Majority Element II

DescriptionGiven an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times.Note: The algorithm should run in linear time and i...

LeetCode 162. Find Peak Element

LeetCode 162. Find Peak Element

DescriptionA 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 a...

LeetCode之Remove Element

1、题目Given an array and a value, remove all instances of that value in place and return the new length.Do not allocate extra space for another array, y...

LeetCode之Next Greater Element I

1、题目You are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of nums2. Find all the next greater numbers for nu...

[LeetCode] Kth Smallest Element in a Sorted Matrix 有序矩阵中第K小的元素

Given a n x n matrix where each of the rows and columns are sorted in ascending order, find the kth smallest element in the matrix...

[LeetCode] Next Greater Element I 下一个较大的元素之一

You are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of nums2. Find all ...

[LeetCode] Next Greater Element III 下一个较大的元素之三

Given a positive 32-bit integer n, you need to find the smallest 32-bit integer which has exactly the same digits existing in...

[LeetCode] Single Element in a Sorted Array 有序数组中的单独元素

Given a sorted array consisting of only integers where every element appears twice except for one element which appears once. Find this single element...

本页面内关键词为智能算法引擎基于机器学习所生成,如有任何问题,可在页面下方点击"联系我们"与我们沟通。