摘要: Compare Version NumbersCompare two version numbersversion1andversion2.Ifversion1>version2return 1, ifversion1 v2){14 return 1;15 }... 阅读全文
posted @ 2015-06-13 23:36 `Liok 阅读(716) 评论(1) 推荐(0) 编辑
摘要: Implement Stack using QueuesImplement the following operations of a stack using queues.push(x) -- Push element x onto stack.pop() -- Removes the eleme... 阅读全文
posted @ 2015-06-13 00:23 `Liok 阅读(512) 评论(0) 推荐(0) 编辑
摘要: Invert Binary TreeInvert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1Trivia:This problem w... 阅读全文
posted @ 2015-06-12 23:37 `Liok 阅读(594) 评论(0) 推荐(0) 编辑
摘要: Rectangle AreaFind the total area covered by tworectilinearrectangles in a2Dplane.Each rectangle is defined by its bottom left corner and top right co... 阅读全文
posted @ 2015-06-10 23:24 `Liok 阅读(256) 评论(0) 推荐(0) 编辑
摘要: Basic CalculatorImplement a basic calculator to evaluate a simple expression string.The expression string may contain open(and closing parentheses), t... 阅读全文
posted @ 2015-06-09 23:22 `Liok 阅读(577) 评论(0) 推荐(0) 编辑
摘要: Nth Highest SalaryWrite a SQL query to get thenthhighest salary from theEmployeetable.+----+--------+| Id | Salary |+----+--------+| 1 | 100 || 2 ... 阅读全文
posted @ 2015-06-08 23:29 `Liok 阅读(253) 评论(0) 推荐(0) 编辑
摘要: Rank ScoresWrite a SQL query to rank scores. If there is a tie between two scores, both should have the same ranking. Note that after a tie, the next ... 阅读全文
posted @ 2015-06-07 23:41 `Liok 阅读(482) 评论(0) 推荐(0) 编辑
摘要: Plus OneGiven a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant dig... 阅读全文
posted @ 2015-06-07 15:55 `Liok 阅读(772) 评论(0) 推荐(0) 编辑
摘要: N-Queens IIFollow up for N-Queens problem.Now, instead outputting board configurations, return the total number of distinct solutions.https://leetcode... 阅读全文
posted @ 2015-06-07 15:28 `Liok 阅读(217) 评论(0) 推荐(0) 编辑
摘要: N-QueensThen-queens puzzle is the problem of placingnqueens on ann×nchessboard such that no two queens attack each other.Given an integern, return all... 阅读全文
posted @ 2015-06-07 15:24 `Liok 阅读(376) 评论(0) 推荐(0) 编辑