题目 There are N gas stations along a circular route, where the amount of gas at station i is gas[i]. You have a…
分类:LeetCode
LeetCode Question 3
Question 3 Given a string, find the length of the longest substring without repeating characters. Example Inpu…
LeetCode算法题-Pascal's Triangle II(Java实现)
这是悦乐书的第171次更新,第173篇原创 01 看题和准备 今天介绍的是LeetCode算法题中Easy级别的第30题(顺位题号是119)。给定非负索引k,其中k≤33,返回Pascal三角形的第k个索引行。行索引从0…
LeetCode算法题-Max Consecutive Ones(Java实现)
这是悦乐书的第242次更新,第255篇原创 01 看题和准备 今天介绍的是LeetCode算法题中Easy级别的第109题(顺位题号是485)。给定二进制数组,找到此数组中连续1的最大数量。例如: 输入:[1,1,0,1…
二刷339. Nested List Weight Sum
Easy 一刷恰好在两个月前,第二次写还是没防备地写出了helper method传参传了int type这种错误. However提交报错后很快反应过来了,自己还是写出来了。 之后尽量别写出类似于这样的传参传int, …
Interview Question - CAP theorem and ACID
看这两篇文章: https://en.wikipedia.org/wiki/CAP_theorem No distributed system is safe from network failures, thus ne…
从前序与中序遍历序列构造二叉树
根据一棵树的前序遍历与中序遍历构造二叉树。 注意: 你可以假设树中没有重复的元素。 前序遍历 preorder = [3,9,20,15,7] 中序遍历 inorder = [9,3,15,20,7] 返回如下的二叉树:…
278. First Bad Version
My Submissions Total Accepted: 77480 Total Submissions: 319521 Difficulty: Easy Contributors: Admin You are a …
[LeetCode] Maximum Product Subarray 求最大子数组乘积
Given an integer array nums, find the contiguous subarray within an array (containing at least one…
[LeetCode] Pyramid Transition Matrix 金字塔转变矩阵
We are stacking blocks to form a pyramid. Each block has a color which is a one letter string, like `…
[Leetcode] Copy List with Random Pointer 复制随机指针
Copy List with Random Pointer A linked list is given such that each node contains an additional random pointer…
【leetcode】44. Wildcard Matching 通配符匹配
1. 题目 Implement wildcard pattern matching with support for ‘?’ and ‘*’. ‘?’…