2014年4月11日

【LeetCode练习题】Unique Paths II

摘要: Unique Paths IIFollow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle and empty space is marked as1and0respectively in the grid.For example,There is one obstacle in the middle of a 3x3 grid as illustrated below.[ 阅读全文

posted @ 2014-04-11 21:45 Allen Blue 阅读(468) 评论(0) 推荐(0) 编辑

【LeetCode练习题】Unique Paths

摘要: Unique PathsA robot is located at the top-left corner of amxngrid (marked 'Start' in the diagram below).The robot can only move either down or right at any point in time. The robot is trying to reach the bottom-right corner of the grid (marked 'Finish' in the diagram below).How many 阅读全文

posted @ 2014-04-11 19:54 Allen Blue 阅读(216) 评论(0) 推荐(0) 编辑

【LeetCode练习题】Longest Valid Parentheses

摘要: Longest Valid ParenthesesGiven a string containing just the characters'('and')', find the length of the longest valid (well-formed) parentheses substring.For"(()", the longest valid parentheses substring is"()", which has length = 2.Another example is")()())& 阅读全文

posted @ 2014-04-11 16:27 Allen Blue 阅读(209) 评论(0) 推荐(0) 编辑

【LeetCode练习题】Scramble String

摘要: Scramble StringGiven a strings1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible representation ofs1="great": great / \ gr eat / \ / \g r e at / \ a tTo scramble the string, we may choose ... 阅读全文

posted @ 2014-04-11 11:43 Allen Blue 阅读(218) 评论(0) 推荐(0) 编辑

导航