coderlong的博客

我料青山多妩媚,料青山看我当如是。

Leetcode Contest94

title: LeetcodeContest94 date: 2018-7-22 23:43:00 categories: - leetcode tags: - Algorithm 摘要: 做的最简单的一次周比赛 872 Leaf-Similar Tr...

2018-07-23 11:38:54

阅读数:35

评论数:0

863. All Nodes Distance K in Binary Tree

原题: We are given a binary tree (with root node root), a target node, and an integer value K. Return a list of the values of all nodes that have a d...

2018-07-02 19:46:49

阅读数:258

评论数:0

26. Remove Duplicates from Sorted Array

Given a sorted array nums, remove the duplicates in-place such that each element appear only once and return the new length. Do not allocate extra s...

2018-06-14 10:51:09

阅读数:26

评论数:0

leetcode 227. Basic Calculator II

Implement a basic calculator to evaluate a simple expression string. The expression string contains only non-negative integers, +, -, *, /operators ...

2018-05-17 23:02:50

阅读数:29

评论数:0

leetcode 165. Compare Version Numbers

Compare two version numbers version1 and version2. If version1 > version2 return1; if version1 < version2 return-1;oth...

2018-05-17 10:22:19

阅读数:24

评论数:0

leetcode 93. Restore IP Addresses

Given a string containing only digits, restore it by returning all possible valid IP address combinations. Example: Input: “25525511135” Output: [...

2018-05-10 17:36:00

阅读数:35

评论数:0

leetcode 529. Minesweeper

title: LeetCode529. Minesweeper date: 2018-05-05 20:01:47 categories: - Algorithm tags: - algorithm - java DFS &&a...

2018-05-09 12:42:09

阅读数:34

评论数:0

leetcode 785. Is Graph Bipartite?

Given an undirected graph, return true if and only if it is bipartite. Recall that a graph is bipartite if we can split it’s set of nodes into two i...

2018-05-09 12:35:56

阅读数:184

评论数:0

leetcode 802. Find Eventual Safe States

fdfg

2018-05-09 12:24:36

阅读数:50

评论数:0

leetcode 547. Friend Circles

There are N students in a class. Some of them are friends, while some are not. Their friendship is transitive in nature. For example, if A is a direc...

2018-05-03 10:39:58

阅读数:33

评论数:0

leetcode 473. Matchsticks to Square

原题目: Remember the story of Little Match Girl? By now, you know exactly what matchsticks the little match girl has, please find out a way you can mak...

2018-04-28 16:14:40

阅读数:23

评论数:0

leetcode 417. Pacific Atlantic Water Flow

原题目: Given an m x n matrix of non-negative integers representing the height of each unit cell in a continent, the “Pacific ocean” touches the left a...

2018-04-27 16:26:31

阅读数:50

评论数:2

LeetCode 43. Multiply Strings

自己来实现字符串的 mul函数, 给定的字符串符合数字的要求,very simple Solution 考虑清楚中间的carry, index 就行了. class Solution { public String multiply(String num1, String num2...

2018-04-26 17:03:40

阅读数:22

评论数:0

二叉树路径的最大值

Given a binary tree, find the maximum path sum. For this problem, a path is defined as any sequence of nodes from some starting node to any node in ...

2018-04-19 10:22:41

阅读数:141

评论数:1

非递归中序遍历的一点解释

递归形式的前序,中序,后序,便利大家应该都是比较熟悉的。但是,有时候,在针对一些对BST遍历过程中节点状态控制的时候,使用非递归形式的算法,往往更加有效,代码更加简洁。 1. 先把二叉树的非递归中序遍历贴出。leetcode题目 public List<Integer&a...

2018-04-16 16:54:30

阅读数:34

评论数:0

357. Count Numbers with Unique Digits

Given a non-negative integer n, count all numbers with unique digits, x, where 0 ≤ x < 10n. Example: Given n = 2, return 91. (The answer...

2018-04-10 19:55:21

阅读数:25

评论数:0

leetcode221_Maximal_Square

我们在来看一道DP问题, 原题是这样的: Given a 2D binary matrix filled with 0’s and 1’s, find the largest square containing only 1’s and return its area. For examp...

2018-04-02 17:22:32

阅读数:48

评论数:0

leetocode213_House_Roubber2

前面写过一道,在一条街道上如何抢劫的最多,这道题是那道题的继承。关键之处在于,前面的那个街道,变成了环形的。 使用java写出DP方程,dp[0] = nums[0], dp[1] = Math.max(nums[0], nums[1]) dp[i] = math.max(dp[i-2] +...

2018-04-02 16:37:17

阅读数:24

评论数:0

leetcode801_Mininum_SwapMakesSequencesIncreasing

title: leetcode801_Mininum_SwapMakesSequencesIncreasing date: 2018-3-20 14:18:40 categories: - leetcode tags: - leetcode We have tw...

2018-03-20 13:26:56

阅读数:418

评论数:0

leetcode055_Jump_game

/** * @author 作者 : coderlong * @version 创建时间:2018年3月16日 下午12:56:08 * 类说明: 愚蠢的解法, 还是要 贪心算法 */ public class leetcode055_Jump_game { public static...

2018-03-16 15:22:25

阅读数:30

评论数:0

提示
确定要删除当前文章?
取消 删除
关闭
关闭