Array
不了痕
风景很美,常回头看看
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
【leetcode 122】Best Time to Buy and Sell Stock II 最佳买卖股票时间
题目Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complete as many transactions as you like (i.e., b...原创 2020-03-05 21:44:25 · 274 阅读 · 0 评论 -
(六)一个判断整形数组中是否有重复数字的简单算法
Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the array, and it should return false if every element is原创 2016-04-12 09:25:56 · 1075 阅读 · 0 评论 -
(七)一个寻找数组中众数的算法
Given an array of sizen, find the majority element. The majority element is the element that appearsmore than⌊ n/2 ⌋times.You may assume that the array is non-empty and the majority element原创 2016-04-14 00:15:02 · 9334 阅读 · 2 评论 -
(三)一个将数组中特定数字放到最后的算法
Given an arraynums, write a function to move all0's to the end of it while maintaining the relative order of the non-zero elements.For example, givennums = [0, 1, 0, 3, 12], after calling you原创 2016-03-31 17:47:41 · 1844 阅读 · 0 评论 -
【leetcode 1】两数之和
Given an array of integers, returnindicesof the two numbers such that they add up to a specific target.You may assume that each input would haveexactlyone solution, and you may not use thesame...原创 2019-12-19 22:50:52 · 749 阅读 · 0 评论
分享