Leetcode
HJ_彼岸
这个作者很懒,什么都没留下…
展开
-
Leetcode 53:Maximum Subarray (DP基础)
题目描述:Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum.Example:Input: [-2,1,-3,4,-1,2,1,-5,4],Output: 6Exp...原创 2019-04-05 11:35:18 · 307 阅读 · 0 评论 -
LeetCode 706:Design HashMap 实现一个简单的哈希映射
题目描述:Design a HashMap without using any built-in hash table libraries.To be specific, your design should include these functions:put(key, value): Insert a (key, value) pair into the HashMap. If...原创 2018-07-27 17:37:45 · 1918 阅读 · 0 评论 -
快手19春招实习笔试(Leetcode 136 && Leetcode 665)
快手19春招实习笔试(Leetcode 136 && Leetcode 665)快手3.30晚笔试编程题,比较简单,两道都是Leetcode原题。1.Leetcode 136 Single NumberGiven a non-empty array of integers, every element appears twice except for one. Find t...原创 2019-04-06 18:11:16 · 539 阅读 · 0 评论 -
网易雷火19春招实习笔试题(Leetcode 440 && 845)
网易雷火3.17 人工智能研究员(NLP方向)笔试题:两道算法题都是Leetcode原题。(Leetcode) 440 && 845)LeetCode 386:再做440之前,可以先做做386;可以算是440的基础题。题目描述:Given an integer n, return 1 - n in lexicographical order.For example,...原创 2019-04-22 20:55:09 · 2797 阅读 · 0 评论 -
【剑指offer】最小的K个数的几种解法
题目:输入n个整数,找出其中最小的k个数。例如输入4、5、1、6、2、7、3、8,则最小的4个数字是1、2、3、4。常见思路:这道题最简单的思路就是先把输入的n个整数排序,排序之后位于最前面的k个数就是最小的k个数。常见的排序算法都可以使用,时间复杂度就是排序的时间复杂度,较好的时间复杂度为O(nlogn)O(nlogn)O(nlogn),这里随便提一下python中的内置sort函数,...原创 2019-06-09 17:03:14 · 725 阅读 · 0 评论