上一页 1 ··· 3 4 5 6 7

2015年2月12日

LeetCode-52 N-Queens II

摘要: Follow up for N-Queens problem.Now, instead outputting board configurations, return the total number of distinct solutions.首先需要确定什么位置放置皇后是合法的(满足同一行,同一... 阅读全文

posted @ 2015-02-12 12:44 linxiong1991 阅读(98) 评论(0) 推荐(0)

2015年1月21日

LeetCode-94 Binary Tree Inorder Traversal

摘要: Given a binary tree, return theinordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1,3,2].Note... 阅读全文

posted @ 2015-01-21 23:47 linxiong1991 阅读(96) 评论(0) 推荐(0)

LeetCode-121 Best Time to Buy and Sell Stock

摘要: Say you have an array for which theithelement is the price of a given stock on dayi.If you were only permitted to complete at most one transaction (ie... 阅读全文

posted @ 2015-01-21 21:20 linxiong1991 阅读(117) 评论(0) 推荐(0)

2015年1月13日

LeetCode-129 Sum Root to Leaf Numbers

摘要: Given a binary tree containing digits from0-9only, each root-to-leaf path could represent a number.An example is the root-to-leaf path1->2->3which rep... 阅读全文

posted @ 2015-01-13 23:39 linxiong1991 阅读(124) 评论(0) 推荐(0)

2015年1月10日

LeetCode-114 Flatten Binary Tree to Linked List

摘要: Given a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 / \ \ 3 4 6The flattened t... 阅读全文

posted @ 2015-01-10 23:28 linxiong1991 阅读(112) 评论(0) 推荐(0)

上一页 1 ··· 3 4 5 6 7

导航