leetCode 面试刷题指南
文章平均质量分 78
beTree_fc
还行吧
展开
-
leetCode - 面试刷题指南 (1)
搜集的关于leetCode中面试经常出现的题目,相关信息如下,转载原文章地址为: https://blog.csdn.net/yutianzuijin/article/details/11477603/ 信息如下:ID问题频率数据结构算法1Two Sum5array、setsort、Two Pointers8String to Integer (atoi)5stringM...转载 2018-04-10 09:55:26 · 996 阅读 · 0 评论 -
239. Sliding Window Maximum
转载作者:ethammmli转载地址:https://segmentfault.com/a/1190000003903509注意时间复杂度为:线性Sliding Window MaximumGiven an array nums, there is a sliding window of size k which is moving from the very left of the array ...转载 2018-05-22 16:58:46 · 123 阅读 · 0 评论 -
LeetCode 142. Linked List Cycle II
Linked List CycleGiven a linked list, determine if it has a cycle in it.Follow up: Can you solve it without using extra space?如何判断一个单链表中有环?Linked List Cycle IIGiven a linked list, return the node wher...转载 2018-05-16 19:14:55 · 120 阅读 · 0 评论 -
287. Find the Duplicate Number
转载作者:GrandYang转载地址:https://www.cnblogs.com/grandyang/p/4843654.html注意点方法二中的原理,实际上是寻找环的起点fast-low其实上是环的长度,然后可以快指针先走(fast-low),然后慢指针再走,相遇的地方是环的起点本作者方法中,fast和low相遇地方取决于非循环部分的长度:如果没有非循环部分,那么,相遇点在环的起点如果有非循...转载 2018-05-27 20:58:23 · 141 阅读 · 0 评论 -
[LeetCode]146. LRU Cache 深入浅出讲解和代码示例
1、汇总概要以下思路涵盖了哈希与双向链表的结合使用、缓存设计等知识点2、题目Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and put.get(key) - Get the value (will ...转载 2018-05-16 19:38:09 · 359 阅读 · 0 评论 -
494. Target Sum
转载作者:愤怒的屎壳郎转载地址:https://blog.csdn.net/hit0803107/article/details/54894227后面给了JAVA版本的代码You are given a list of non-negative integers, a1, a2, ..., an, and a target, S. Now you have 2 symbols + and -. F...转载 2018-05-28 20:42:47 · 178 阅读 · 0 评论 -
LeetCode - 面试刷题指南 (2)
背景 筛选了一部分比较经典的leetcode题目,比较懒,就没有整理成表格了。。。正文1.two sum hashmap15.3sum 排序,遍历53. Maximum Subarray Subarray 遍历一遍即可56. Merge Intervals。 遍历一边,一个pre-last 判断当前pre和上一个last62. Unique Paths 动态规划64. Minim...原创 2018-06-04 21:36:47 · 911 阅读 · 0 评论 -
LeetCode 416. Partition Equal Subset Sum
题目链接:https://leetcode.com/problems/partition-equal-subset-sum/Given a non-empty array containing only positive integers, find if the array can be partitioned into two subsets such that the sum of elem...原创 2018-05-24 14:37:52 · 145 阅读 · 0 评论 -
139. Word Break
转载地址:https://blog.csdn.net/gao1440156051/article/details/52192981139. Word BreakGiven a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one ...转载 2018-05-29 20:36:50 · 301 阅读 · 0 评论 -
795. Number of Subarrays with Bounded Maximum
转载作者:Faldict转载地址:https://blog.csdn.net/Faldict/article/details/79480925795. Number of Subarrays with Bounded MaximumProblem DescriptionWe are given an array A of positive integers, and two positive in...转载 2018-05-15 21:36:29 · 165 阅读 · 0 评论 -
LeetCode 741. Cherry Pickup 动态规划 [Hard]
转载作者:Grandyang转载地址:http://www.cnblogs.com/grandyang/p/8215787.html正文In a N x N grid representing a field of cherries, each cell is one of three possible integers. 0 means the cell is empty, so you can...转载 2018-05-15 16:25:11 · 647 阅读 · 1 评论 -
leetCode28 strStr kmp 解法
转载地址:博主:c_cloud http://www.cnblogs.com/c-cloud/p/3224788.html转载 leetCode28 strStr,最简单的方法是循环比较然后回溯,但是效率比较低,比较合适而且出名的方法是使用kmp方法,不需要回溯,时间复杂度log(n),Macgic!! 下面是一片博主写的,很 nice,转载一下:前言 之前对km...转载 2018-04-18 20:15:12 · 259 阅读 · 0 评论 -
91 Decode Ways
原文地址:https://blog.csdn.net/worldwindjp/article/details/19938131主要问题:特殊数字100、101、0的判断上因为原文要求数字为1-26,所以01,00,这些不符合要求,但是从数值(int)上符合要求正文 A message containing letters from A-Z is being encoded to numbers u...转载 2018-05-08 20:58:24 · 249 阅读 · 0 评论 -
leetCode Merge Intervals 合并区间/Insert Interval 插入区间
记录地址:http://www.cnblogs.com/grandyang/p/4367569.htmlhttp://www.cnblogs.com/grandyang/p/4370601.html转载 2018-04-21 21:58:32 · 156 阅读 · 0 评论 -
LeetCode 152: Maximum Product Subarray
Maximum Product Subarray Total Accepted: 16617 Total Submissions: 96901Find the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given th...转载 2018-05-17 20:44:03 · 123 阅读 · 0 评论 -
152. Number of Islands
Q: Given a 2d grid map of ‘1’s (land) and ‘0’s (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may ass...转载 2018-05-17 20:44:42 · 130 阅读 · 0 评论 -
leetCode127 . Word Ladder Java版 (单词等长变换)
转载地址:https://blog.csdn.net/mine_song/article/details/68951974127. Word LadderGiven two words (beginWord and endWord), and a dictionary's word list, find the length of shortest transformation sequence ...转载 2018-05-05 09:25:02 · 256 阅读 · 0 评论 -
132. Palindrome Partitioning II
转载作者:Grandyang转载地址:http://www.cnblogs.com/grandyang/p/4271456.htmlGiven a string s, partition s such that every substring of the partition is a palindrome.Return the minimum cuts needed for a palindro...转载 2018-05-11 20:00:42 · 120 阅读 · 0 评论 -
LeetCode 74. Dungeon Game 动态规划
转载作者:GrandYang转载地址:http://www.cnblogs.com/grandyang/p/4233035.html[LeetCode] Dungeon Game 地牢游戏 The demons had captured the princess (P) and imprisoned her in the bottom-right corner of a dungeon. The...转载 2018-05-13 19:35:31 · 180 阅读 · 0 评论 -
从1到n整数中1出现的次数:O(logn)算法
转载原文:统计1数目1. 题目描述输入一个整数n,求从1到n这n个整数的十进制表示中1出现的次数。例如输入12,从1到12这些整数中包含1的数字有1,10,11和12,1一共出现了5次。2. 题目来源第一次看到是在《剑指Offer》第2版上,面试题32。leetcode和牛客网上都有这道题。3. 本文的目的看了《剑指Offer》上的解法,我觉得不能算好:这段解释描述有些...原创 2018-10-26 10:23:20 · 845 阅读 · 0 评论