- 博客(34)
- 收藏
- 关注
原创 LeetCode OJ Isomorphic Strings
Given two strings s and t, determine if they are isomorphic.Two strings are isomorphic if the characters in s can be replaced to get t.All occurrences of a character must be replaced with anot
2015-04-29 23:40:34 546
原创 Sicily 14257. Myvim Plugin
14257. Myvim PluginConstraintsTime Limit: 1 secs, Memory Limit: 256 MBDescriptionFor every programmer, coding HTML & CSS is a very boring thing.For example, writing an html tag with id
2015-04-29 21:49:08 568
原创 Sicily 14180. Encoded Coordinates
14180. Encoded CoordinatesConstraintsTime Limit: 1 secs, Memory Limit: 256 MBDescriptionYou have been monitoring a terrorist cell that is planning a big attack somewhere close. T
2015-04-29 19:23:42 559
原创 LeetCode OJ Count Primes
Description:Count the number of prime numbers less than a non-negative number, nclick to show more hints.Credits:Special thanks to @mithmatt for adding this problem and creating all te
2015-04-29 11:12:18 557
原创 EMU8086 简单汇编程序&实现5个BYTES的数据相加
一个简单的汇编程序: .MODEL SMALL .STACK 64 .DATADATA1 DB 52HDATA2 DB 29HSUM DB 0 .CODE MAIN PROC FAR MOV AX, @DATA
2015-04-27 20:17:54 6201
原创 Sicily 14181. Flying Safely
14181. Flying SafelyConstraintsTime Limit: 1 secs, Memory Limit: 256 MBDescriptionDue to budget cuts, even spies have to use commercial airlines nowadays to travel between cities
2015-04-26 19:29:51 818 1
原创 LeetCode OJ Remove Linked List Elements
Remove all elements from a linked list of integers that have value val.ExampleGiven: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6, val = 6Return: 1 --> 2 --> 3 --> 4 --> 5Credits:Special than
2015-04-24 13:25:09 630
原创 LeetCode OJ Happy Number
Write an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of the squares
2015-04-22 19:26:18 595
原创 Sicily 14184. Incognito
14184. IncognitoConstraintsTime Limit: 1 secs, Memory Limit: 256 MBDescriptionSpies use attributes to disguise themselves to make sure that they are not recognized. For example,
2015-04-19 23:43:02 662
原创 LeetCode OJ Bitwise AND of Numbers Range
Given a range [m, n] where 0 For example, given the range [5, 7], you should return 4.Credits:Special thanks to @amrsaqr for adding this problem and creating all test cases.给出一个非负整数闭区间,求从区
2015-04-18 19:59:43 543
原创 Sicily 7693. Cards
7693. CardsConstraintsTime Limit: 15 secs, Memory Limit: 256 MBDescriptionThere are many blue cards and red cards on the table. For each card, an integer number greater than 1 is
2015-04-14 21:40:13 569
原创 Sicily 13460. Passwords
13460. PasswordsConstraintsTime Limit: 1 secs, Memory Limit: 256 MBDescriptionMirko is an evil plotting genius and has gotten hold of a list of all possible passwords for a certa
2015-04-13 20:33:32 724
原创 LeetCode Department Top Three Salaries
The Employee table holds all employees. Every employee has an Id, and there is also a column for the department Id.+----+-------+--------+--------------+| Id | Name | Salary | DepartmentId |+--
2015-04-13 19:47:44 741
原创 Sicily 13980. Record Keeping
13980. Record KeepingConstraintsTime Limit: 1 secs, Memory Limit: 256 MBDescriptionFarmer John has been keeping detailed records of his cows as they enter the barn for milking. E
2015-04-13 10:59:01 829
原创 Sicily 13981. Cow Baseball
13981. Cow BaseballConstraintsTime Limit: 1 secs, Memory Limit: 256 MBDescriptionFarmer John's N cows (3 As Farmer John watches, he observes a group of three cows (X,Y,Z) com
2015-04-13 10:48:15 807
原创 Sicily 13983. Milk Scheduling
13983. Milk SchedulingConstraintsTime Limit: 1 secs, Memory Limit: 256 MBDescriptionFarmer John has N cows that need to be milked (1 Being impatient animals, some cows will r
2015-04-13 00:49:46 1324
原创 LeetCode Nth Highest Salary
Write a SQL query to get the nth highest salary from the Employee table.+----+--------+| Id | Salary |+----+--------+| 1 | 100 || 2 | 200 || 3 | 300 |+----+--------+For exampl
2015-04-12 22:58:46 568
原创 LeetCode Rank Scores
Write 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 ranking number should be the next consecutive integer value.
2015-04-12 18:43:33 582
原创 Postgresql 自增语句
如果只是简单地从1开始,递增值为1,可以这样写,serail是一种特殊的类型:往Employee中添加值及其结果:如果想设置更加详细的项,比如起始、递增值、最大值、最小值,可以定义一个sequence。在sequence中,如果是no minvalue、no maxvalue表示最小最大值为-1,注意最小值不能大于最大值.。然后改变表格的列:往E
2015-04-12 18:07:36 3244
原创 LeetCode OJ Consecutive Numbers
Write a SQL query to find all numbers that appear at least three times consecutively.+----+-----+| Id | Num |+----+-----+| 1 | 1 || 2 | 1 || 3 | 1 || 4 | 2 || 5 | 1 || 6 | 2
2015-04-12 15:51:24 696
原创 LeetCode Department Highest Salary
The Employee table holds all employees. Every employee has an Id, a salary, and there is also a column for the department Id.+----+-------+--------+--------------+| Id | Name | Salary | Departme
2015-04-12 15:21:01 711
原创 LeetCode OJ Employees Earning More Than Their Managers
The Employee table holds all employees including their managers. Every employee has an Id, and there is also a column for the manager Id.+----+-------+--------+-----------+| Id | Name | Salary |
2015-04-12 14:29:12 717
原创 LeetCode Customers Who Never Order
Suppose that a website contains two tables, the Customers table and the Orders table. Write a SQL query to find all customers who never order anything.Table: Customers.+----+-------+| Id | Na
2015-04-12 14:08:18 656
原创 LeetCode Delete Duplicate Emails
Write a SQL query to delete all duplicate email entries in a table named Person, keeping only unique emails based on its smallest Id.+----+------------------+| Id | Email |+----+-----
2015-04-12 12:19:47 1095
原创 LeetCode Rising Temperature
Given a Weather table, write a SQL query to find all dates' Ids with higher temperature compared to its previous (yesterday's) dates.+---------+------------+------------------+| Id(INT) | Date(DA
2015-04-12 10:59:28 932
原创 LeetCode Second Highest Salary
Write a SQL query to get the second highest salary from the Employee table.+----+--------+| Id | Salary |+----+--------+| 1 | 100 || 2 | 200 || 3 | 300 |+----+--------+For exa
2015-04-11 22:50:15 703
原创 LeetCode OJ Combine Two Tables
Table: Person+-------------+---------+| Column Name | Type |+-------------+---------+| PersonId | int || FirstName | varchar || LastName | varchar |+-------------+---------+Per
2015-04-11 19:48:45 584
原创 LeetCode OJ Duplicate Emails
Write a SQL query to find all duplicate emails in a table named Person.+----+---------+| Id | Email |+----+---------+| 1 | [email protected] || 2 | [email protected] || 3 | [email protected] |+----+---------+For
2015-04-11 17:00:46 534
原创 Sicily 13914. Train Passengers
13914. Train PassengersConstraintsTime Limit: 1 secs, Memory Limit: 256 MBDescriptionThe Nordic Company of Passing Carriages is losing money at an alarming rate because most of t
2015-04-10 18:27:39 735
原创 LeetCode OJ Number of Islands
Given a 2d grid map of '1's (land) and'0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assum
2015-04-09 08:20:45 611
原创 Sicily 14261. Generating Words
14261. Generating WordsConstraintsTime Limit: 1 secs, Memory Limit: 256 MBDescriptionGiven two words A and B, a word W is said to be good if it satisfies the following conditions
2015-04-08 00:22:31 582
原创 Sicily 14256. Pseudo Semiprime
14256. Pseudo SemiprimeConstraintsTime Limit: 1 secs, Memory Limit: 256 MBDescriptionIn number theory, a positive integer is a semiprime if it is the product of two primes. For example, 35 i
2015-04-07 23:53:09 474
原创 Sicily 14254. Wall Painting
14254. Wall PaintingConstraintsTime Limit: 1 secs, Memory Limit: 256 MBDescriptionA wall looks dirty, so Alpha has been sent there to repaint it in order to make it clean.The wall is H fee
2015-04-07 12:03:09 564
原创 LeetCode OJ Binary Tree Right Side View
Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.For example:Given the following binary tree, 1
2015-04-04 07:19:30 581
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人