上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 20 下一页

[LeetCode] Surrounded Regions, Solution

摘要: Given a 2D board containing 'X' and 'O', capture all regions surrounded by 'X'.A region is captured by flipping all 'O's into 'X's in that surrounded ... 阅读全文
posted @ 2013-03-04 09:56 小刀初试 阅读(169) 评论(0) 推荐(0)

the complexity is no longer O(lgn), right?

摘要: the complexity is no longer O(lgn), right? 阅读全文
posted @ 2013-03-01 07:25 小刀初试 阅读(95) 评论(0) 推荐(0)

[LeetCode] Longest Consecutive Sequence, Solution

摘要: Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given [100, 4, 200, 1, 3, 2],The longest... 阅读全文
posted @ 2013-02-23 16:02 小刀初试 阅读(161) 评论(0) 推荐(0)

[LeetCode] Sum Root to Leaf Numbers, Solution

摘要: Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number.An example is the root-to-leaf path 1->2->3 which... 阅读全文
posted @ 2013-02-23 15:35 小刀初试 阅读(133) 评论(0) 推荐(0)

[LeetCode] Word Ladder II, Solution

摘要: Given two words (start and end), and a dictionary, find all shortest transformation sequence(s) from start to end, such that:Only one letter can be ch... 阅读全文
posted @ 2013-02-23 10:24 小刀初试 阅读(175) 评论(0) 推荐(0)

[LeetCode] Valid Palindrome, Solution

摘要: Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a canal: Pana... 阅读全文
posted @ 2013-02-22 07:47 小刀初试 阅读(141) 评论(0) 推荐(0)

Summary

摘要: [LeetCode] Remove Duplicates from Sorted Array 解题报告Given a sorted array, remove the duplicates in place such that each element appear only once and re... 阅读全文
posted @ 2013-02-21 11:47 小刀初试 阅读(232) 评论(0) 推荐(0)

[Yahoo] Cloest palindrome number, Solution

摘要: Given an integer, print the closest number to it that is a palindrome - eg, the number "1224" would return "1221".[Thoughts]pseudo code: (with two exa... 阅读全文
posted @ 2013-02-04 04:17 小刀初试 阅读(187) 评论(0) 推荐(0)

[Google] URL query with wild card

摘要: In our indexes, we have millions of URLs each of which has a link to the page content, now, suppose a user type a query with wild cards *, which repre... 阅读全文
posted @ 2013-02-03 07:19 小刀初试 阅读(118) 评论(0) 推荐(0)

[Microsoft] Intealeaving of two given strings, Solution

摘要: Desgin an algorithm to find whether a given sting is formed by the Intealeaving of two given strings. For example, stringA: ABCEF...string B: ABCA...... 阅读全文
posted @ 2013-02-03 05:55 小刀初试 阅读(206) 评论(0) 推荐(0)
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 20 下一页