摘要: Longest Valid ParenthesesGiven a string containing just the characters'('and')', find the length of the longest valid (well-formed) parentheses substr... 阅读全文
posted @ 2015-05-16 17:22 `Liok 阅读(406) 评论(0) 推荐(0) 编辑
摘要: Insert IntervalGiven a set ofnon-overlappingintervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals... 阅读全文
posted @ 2015-05-16 16:49 `Liok 阅读(543) 评论(0) 推荐(0) 编辑
摘要: Employees Earning More Than Their ManagersTheEmployeetable holds all employees including their managers. Every employee has an Id, and there is also a... 阅读全文
posted @ 2015-05-16 16:38 `Liok 阅读(302) 评论(0) 推荐(0) 编辑
摘要: Duplicate EmailsWrite a SQL query to find all duplicate emails in a table namedPerson.+----+---------+| Id | Email |+----+---------+| 1 | a@b.com |... 阅读全文
posted @ 2015-05-16 16:36 `Liok 阅读(169) 评论(0) 推荐(0) 编辑
摘要: Customers Who Never OrderSuppose that a website contains two tables, theCustomerstable and theOrderstable. Write a SQL query to find all customers who... 阅读全文
posted @ 2015-05-16 16:34 `Liok 阅读(191) 评论(0) 推荐(0) 编辑
摘要: Delete Duplicate EmailsWrite a SQL query to delete all duplicate email entries in a table namedPerson, keeping only unique emails based on itssmallest... 阅读全文
posted @ 2015-05-16 16:32 `Liok 阅读(591) 评论(0) 推荐(0) 编辑
摘要: Rising TemperatureGiven aWeathertable, write a SQL query to find all dates' Ids with higher temperature compared to its previous (yesterday's) dates.+... 阅读全文
posted @ 2015-05-16 16:30 `Liok 阅读(393) 评论(0) 推荐(0) 编辑
摘要: Combine Two TablesTable:Person+-------------+---------+| Column Name | Type |+-------------+---------+| PersonId | int || FirstName | varc... 阅读全文
posted @ 2015-05-16 16:26 `Liok 阅读(260) 评论(0) 推荐(0) 编辑
摘要: Valid NumberValidate if a given string is numeric.Some examples:"0"=>true" 0.1 "=>true"abc"=>false"1 a"=>false"2e10"=>trueNote:It is intended for the ... 阅读全文
posted @ 2015-05-16 16:18 `Liok 阅读(300) 评论(0) 推荐(0) 编辑
摘要: Same TreeGiven two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally ide... 阅读全文
posted @ 2015-05-16 16:14 `Liok 阅读(186) 评论(0) 推荐(0) 编辑
摘要: Maximum Depth of Binary TreeGiven a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root ... 阅读全文
posted @ 2015-05-16 16:13 `Liok 阅读(155) 评论(0) 推荐(0) 编辑
摘要: Majority ElementGiven an array of sizen, find the majority element. The majority element is the element that appears more than⌊ n/2 ⌋times.You may ass... 阅读全文
posted @ 2015-05-16 16:08 `Liok 阅读(399) 评论(0) 推荐(0) 编辑
摘要: Excel Sheet Column TitleGiven a positive integer, return its corresponding column title as appear in an Excel sheet.For example: 1 -> A 2 -> B ... 阅读全文
posted @ 2015-05-16 16:05 `Liok 阅读(444) 评论(0) 推荐(0) 编辑
摘要: Excel Sheet Column NumberRelated to questionExcel Sheet Column TitleGiven a column title as appear in an Excel sheet, return its corresponding column ... 阅读全文
posted @ 2015-05-16 16:03 `Liok 阅读(336) 评论(0) 推荐(0) 编辑
摘要: Number of 1 BitsWrite a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as theHamming weight).For exampl... 阅读全文
posted @ 2015-05-16 16:01 `Liok 阅读(490) 评论(0) 推荐(0) 编辑