代码改变世界

[LeetCode] 1143. Longest common subsequences_ Medium tag: Dynamic Programming

2019-04-28 02:27 by Johnson_强生仔仔, 264 阅读, 0 推荐, 收藏, 编辑
摘要:Given two strings, find the longest common subsequence (LCS). Example Example 1: Input: "ABCD" and "EDCA" Output: 1 Explanation: LCS is 'A' or 'D' or 阅读全文

[LeetCode] 139. Word Break_ Medium tag: Dynamic Programming

2019-04-26 11:08 by Johnson_强生仔仔, 455 阅读, 0 推荐, 收藏, 编辑
摘要:Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, determine if s can be segmented into a space-separated sequ 阅读全文

[LeetCode] 132. Palindrome Partitioning II_ Hard tag: Dynamic Programming

2019-04-25 11:14 by Johnson_强生仔仔, 287 阅读, 0 推荐, 收藏, 编辑
摘要:Given a string s, partition s such that every substring of the partition is a palindrome. Return the minimum cuts needed for a palindrome partitioning 阅读全文

[LeetCode] 45. Jump Game II_ Hard tag: Dynamic Programming, Greedy

2019-04-24 10:41 by Johnson_强生仔仔, 255 阅读, 0 推荐, 收藏, 编辑
摘要:Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maxim 阅读全文

[LeetCode] 55. Jump Game_ Medium tag: Dynamic Programming

2019-04-24 10:35 by Johnson_强生仔仔, 324 阅读, 0 推荐, 收藏, 编辑
摘要:Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maxim 阅读全文

[LeetCode] 70. Climbing Stairs_ Easy tag: Dynamic Programming

2019-04-23 09:59 by Johnson_强生仔仔, 248 阅读, 0 推荐, 收藏, 编辑
摘要:You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you cl 阅读全文

[LeetCode] 63. Unique Paths II_ Medium tag: Dynamic Programming

2019-04-23 09:36 by Johnson_强生仔仔, 260 阅读, 0 推荐, 收藏, 编辑
摘要:A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only move either down or right at any p 阅读全文

[LeetCode] 120. Triangle _Medium tag: Dynamic Programming

2019-04-22 04:24 by Johnson_强生仔仔, 221 阅读, 0 推荐, 收藏, 编辑
摘要:Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. For example, given the fo 阅读全文

[LeetCode] 236. Lowest Common Ancestor of a Binary Tree_ Medium tag: DFS, Divide and conquer

2019-04-19 06:07 by Johnson_强生仔仔, 248 阅读, 0 推荐, 收藏, 编辑
摘要:Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. According to the definition of LCA on Wikipedia: “The lowes 阅读全文

[LeetCode] 系统刷题4_Binary Tree & Divide and Conquer

2019-04-18 09:14 by Johnson_强生仔仔, 334 阅读, 0 推荐, 收藏, 编辑
摘要:The most important : [LeetCode] questions conclustion_BFS, DFS 参考[LeetCode] questions conlusion_InOrder, PreOrder, PostOrder traversal 可以对binary tree进 阅读全文
上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 39 下一页