
leetcode
文章平均质量分 58
JacKnights
这个作者很懒,什么都没留下…
展开
-
每周LeetCode算法题(一):Longest Substring Without Repeating Characters
每周LeetCode算法题(一)题目: 3. Longest Substring Without Repeating Characters Given a string, find the length of the longest substring without repeating characters. Examples: Given “ab原创 2017-09-08 19:54:00 · 327 阅读 · 0 评论 -
每周LeetCode算法题(十九)279. Perfect Squares
每周LeetCode算法题(十九)题目: 279. Perfect Squares Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, …) which sum to n. For example, given n = 12, re原创 2018-01-20 11:52:29 · 285 阅读 · 0 评论 -
每周LeetCode算法题(十八)494. Target Sum
每周LeetCode算法题(十八)题目: 494. Target Sum You are given a list of non-negative integers, a1, a2, …, an, and a target, S. Now you have 2 symbols + and -. For each integer, you should choose one from + and原创 2018-01-08 17:38:07 · 301 阅读 · 0 评论 -
每周算法题(十七)8.15最大公共子图
每周算法题(十七)题目: 8.15最大公共子图 已知G1 = (V1, E1), G2 = (V2, E2),正整数b,G1,G2分别删除部分节点后剩下的至少b个节点构成的子图要相同。 证明最大公共子图问题是NP完全问题。证明过程首先这是个多项式时间内能检验是否正确的问题,即NP问题。并且已知独立集问题是NP完全问题。如果能将独立集问题归约到本问题,则证明了最大公共子图问题是NP完原创 2017-12-28 15:37:36 · 1339 阅读 · 0 评论 -
每周LeetCode算法题(十五)403. Frog Jump
每周LeetCode算法题(十五)题目: 403. Frog Jump A frog is crossing a river. The river is divided into x units and at each unit there may or may not exist a stone. The frog can jump on a stone, but it must not j原创 2017-12-17 16:33:04 · 476 阅读 · 0 评论 -
每周LeetCode算法题(十六)312. Burst Balloons
每周LeetCode算法题(十六)题目: 312. Burst Balloons Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represented by array nums. You are asked to burst all the balloons. If t原创 2017-12-24 17:31:13 · 478 阅读 · 0 评论 -
每周LeetCode算法题(十二): 647. Palindromic Substrings
每周LeetCode算法题(十二)题目: 647. Palindromic Substrings Given a string, your task is to count how many palindromic substrings in this string. The substrings with different start indexes or end indexes原创 2017-11-26 16:01:41 · 302 阅读 · 0 评论 -
每周LeetCode算法题(十三)152. Maximum Product Subarray
每周LeetCode算法题(十三)题目: 152. Maximum Product Subarray Find the contiguous subarray within an array (containing at least one number) which has the largest product. For example, given the array [2,3,原创 2017-12-02 11:03:24 · 270 阅读 · 0 评论 -
每周LeetCode算法题(十四)516. Longest Palindromic Subsequence
每周LeetCode算法题(十四)题目: 516. Longest Palindromic Subsequence Given a string s, find the longest palindromic subsequence’s length in s. You may assume that the maximum length of s is 1000. Example原创 2017-12-10 15:43:43 · 388 阅读 · 0 评论 -
每周LeetCode算法题(九): 72. Edit Distance
每周LeetCode算法题(七)题目: 72. Edit Distance Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.) You have the f原创 2017-11-02 15:26:09 · 285 阅读 · 0 评论 -
每周LeetCode算法题(十一) 题目: 322. Coin Change
每周LeetCode算法题(十一)题目: 322. Coin Change You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you need to make原创 2017-11-19 11:44:58 · 343 阅读 · 0 评论 -
每周LeetCode算法题(十): 304. Range Sum Query 2D - Immutable
每周LeetCode算法题(十)题目: 304. Range Sum Query 2D - Immutable Given a 2D matrix matrix, find the sum of the elements inside the rectangle defined by its upper left corner (row1, col1) and lower right corn原创 2017-11-09 20:30:41 · 278 阅读 · 0 评论 -
每周LeetCode算法题(六): 617. Merge Two Binary Trees
每周LeetCode算法题(六)题目: 617. Merge Two Binary Trees Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are no原创 2017-10-13 22:36:50 · 345 阅读 · 0 评论 -
每周LeetCode算法题(八): 题目: 221. Maximal Square & 85. Maximal Rectangle
每周LeetCode算法题(八)题目1: 221. Maximal Square 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 example, given the following matri原创 2017-10-27 21:14:43 · 329 阅读 · 0 评论 -
每周LeetCode算法题(五):416. Partition Equal Subset Sum
每周LeetCode算法题(五)题目: 416. 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 elements in b原创 2017-10-04 15:22:53 · 367 阅读 · 0 评论 -
每周LeetCode算法题(七): 题目: 198. House Robber
每周LeetCode算法题(七)题目: 198. House Robber You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robb原创 2017-10-19 12:42:27 · 447 阅读 · 0 评论 -
每周LeetCode算法题(三):Next Permutation
每周LeetCode算法题(三)题目: 31. Next Permutation Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not原创 2017-09-21 22:59:22 · 398 阅读 · 0 评论 -
每周LeetCode算法题(四):Merge k Sorted Lists
每周LeetCode算法题(四)题目: 23. Merge k Sorted Lists Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. 解法分析题目意思很简明,就是归并k个有序链表。这很像我们上学期数据库里讲的多路归并啊。归并排序原创 2017-09-27 20:28:10 · 372 阅读 · 0 评论 -
每周LeetCode算法题(二十)210. Course Schedule II
每周LeetCode算法题(二十)题目: 210. Course Schedule II There are a total of n courses you have to take, labeled from 0 to n - 1. Some courses may have prerequisites, for example to take course 0 you have原创 2018-01-20 11:56:44 · 280 阅读 · 0 评论