
leetcode
文章平均质量分 54
简单点1024
熟悉ML,DM过程,参与ETL架构搭建,进行BI分析,热爱新技术
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
leetcode3二叉树系列
#从尾到头打印链表class Solution: def printLinkedListFromHeadToTail(self,linkedList): if not linkedList: if linkedList.next!=None: self.printLinkedListFromHeadToTail(linkedList.next) print(linkedList.next.val).原创 2021-05-25 10:03:45 · 341 阅读 · 0 评论 -
3Sum Closest
3Sum Closest:Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would...原创 2018-04-25 07:43:22 · 135 阅读 · 0 评论 -
First Missing Positive 类似计数排序
First Missing Positive 类似计数排序[java] view plain copypublic int firstMissingPositive(int[] A) { if(A==null || A.length==0) { return 1; } for(int i=0;i<A.length...原创 2018-04-25 07:43:27 · 157 阅读 · 0 评论 -
Minimum Size Subarray Sum(滑动窗口和两个指针)
一、问题描述Description:Description:Given an array of n positive integers and a positive integer s, find the minimal length of a subarray of which the sum ≥ s. If there isn’t one, return 0 instead.For examp...原创 2018-04-25 07:43:34 · 429 阅读 · 0 评论 -
Combination sum||| & 1v(动态规划)
立即登录[LeetCode] Combination Sum III | Combination Sum IV数组 java backtracking linspiration 2016年06月03日发布赞 | 0收藏 | 11.4k 次浏览Combination Sum IIIProblemFind all possible combinations of k numbers th...原创 2018-04-25 07:43:39 · 251 阅读 · 0 评论 -
Summary Ranges(两个指针)
Summary Ranges Total Accepted: 511 Total Submissions: 2271Given a sorted integer array without duplicates, return the summary of its ranges.For example, given [0,1,2,4,5,7], return ["0->2","4->5...原创 2018-04-25 07:43:43 · 303 阅读 · 0 评论 -
乘积小于K的子数组个数
QuestionYour are given an array of positive integers nums.Count and print the number of (contiguous) subarrays where the product of all the elements in the subarray is less than k.Example 1:I...原创 2018-08-30 09:42:45 · 1160 阅读 · 0 评论 -
找数组中没有出现的数字
设一个数组里面的元素范围是1<=a[i]<=n(n是数组的size),里面的元素只可能出现一次或两次,找到这个数组中没有出现的数字。例如: 输入为 [4,3,2,7,8,2,3,1] 输出为 [5,6] 在数组中下标从0开始,本题下标范围为0-7,而数组元素的值范围为1-8,所以想着如果能把数组元素的值与下标联系起来。通过遍历数组,将每个数组元素设为负值,在遍历的整个过程中,...转载 2018-08-30 09:41:34 · 2222 阅读 · 0 评论 -
数组中重复出现的数
给定一个整数数组 a,其中1 ≤ a[i] ≤ n (n为数组长度), 其中有些元素出现两次而其他元素出现一次。找到所有出现两次的元素。你可以不用到任何额外空间并在O(n)时间复杂度内解决这个问题吗?示例:输入:[4,3,2,7,8,2,3,1]输出:[2,3]代码:class Solution: def findDuplicates(self, nums)...转载 2018-08-30 09:41:23 · 724 阅读 · 0 评论 -
GBDT问题汇总
GBDT几问本篇文章主要介绍GBDT基本原理以及一些细节性的东西,这些东西更多在面试使用,或者对于二次创新使用,主要内容有以下几个方面: GBDT几问 Boosting算法Bagging算法介绍 GBDT基本原理 GBDT如何正则化 GBDT分裂规则 GBDT的“梯度提升”体现在那个阶段 GBDT如何做特征选择 GBDT为什么使用cart回...转载 2018-08-30 09:41:09 · 10849 阅读 · 1 评论 -
Container with water
public class Solution { public int maxArea(int[] height) { int left = 0, right = height.length - 1, maxArea = 0; while(left < right){ // 每次更新最大面积(盛水量) ma...原创 2018-04-25 07:43:09 · 155 阅读 · 0 评论