昨天总结完二叉树与回溯后,想着顺手刷一道相关的Leetcode巩固一下,却不想随意选的一道题,竟然引起了如此腥风血...[作者空间]
Question In a 2 dimensional array grid, each value grid[i...[作者空间]
Question You're given strings J representing the types of...[作者空间]
Question Given a set of distinct integers, nums, return a...[作者空间]
Java Algorithm Problems 序言 从开始这个Github已经有将近三四年时间, 很高兴可以帮到...[作者空间]
Given a binary tree, find the leftmost value in the last ...[作者空间]
Description: Given a sequence of integers, find the longe...[作者空间]
Given an array and a value, remove all instances of that ...[作者空间]
Given an array of integers where 1 ≤ a[i] ≤ n (n = size o...[作者空间]
Difficulty: Easy【题目】Given two sorted integer arrays A and...[作者空间]
Given a positive integer n, break it into the sum of at l...[作者空间]
背景 一年多以前我在知乎上答了有关LeetCode的问题, 分享了一些自己做题目的经验。 张土汪:刷leetcod...[作者空间]
M 方法一: 60% 和check anagram 想法一样:转化并sort char array,用来作为key...[作者空间]
精力旺盛症。自己做的时候,想的太复杂,做起了binarysearch,企图节省时间。下次要算清楚,是否有意义。bi...[作者空间]
不难,但是要考虑好如何handle ""。因为平时都把“” 当做Null对待,这里就犯浑了。这题,要把Null特别...[作者空间]
屌炸天的4行代码。我洋洋洒洒那么多行,最后还不work.看了solution, 如此精简。 主要想法:Recurs...[作者空间]
这个题目相对简单. 做的时候我先考虑起来k条怎么办. 那么用个map把index和每个listmark一下就好了。...[作者空间]
李特这的这个题目不错。写一遍example就能看出来inorder traversal。当然啦,不能直接全部tra...[作者空间]
再一次理解错题意. peek() 就是头顶,但是不一定是最大值啊。总是把PEEK想成了最大值,然后用2 STACK...[作者空间]
大概意思就是把2D list里面的element全部遍历一遍。注意啊,一开始理解题意搞错:我以为是必须要排序正确,...[作者空间]