上一页 1 ··· 49 50 51 52 53 54 55 56 57 ··· 81 下一页
摘要: https://leetcode.com/problems/zigzag-conversion/The string"PAYPALISHIRING"is written in a zigzag pattern on a given number of rows like this: (you may... 阅读全文
posted @ 2015-09-01 20:01 雪溯 阅读(152) 评论(0) 推荐(0)
摘要: https://leetcode.com/problems/reverse-integer/class Solution {public: int inf = ~0u >> 1; int reverse(int x) { if(x == 0)return 0; ... 阅读全文
posted @ 2015-09-01 18:06 雪溯 阅读(213) 评论(0) 推荐(0)
摘要: 思路:设现在可用区间在nums1是[s1,t1),nums2:[s2,t2)1.当一个数组可用区间为0的时候,由于另一个数组是已经排过序的,所以直接可得当要取的是最小值或最大值时,也直接可得2.明显两个数组总长度为偶数的时候需要取最中间两个元素/2.0,长度为奇数时,只需要求最中间那个.所以只需要分... 阅读全文
posted @ 2015-09-01 13:29 雪溯 阅读(198) 评论(0) 推荐(0)
摘要: https://leetcode.com/problems/bitwise-and-of-numbers-range/[n,m]区间的合取总值就是n,m对齐后前面一段相同的数位的值比如5:1017:111结果就是4:100class Solution {public: int rangeBit... 阅读全文
posted @ 2015-08-27 19:27 雪溯 阅读(179) 评论(0) 推荐(0)
摘要: https://leetcode.com/problems/longest-substring-without-repeating-characters/思路:从某点结束所能取到的最早开头是到目前出现倒数第二次的字符的最末位置后一位如图:(S代表起点,T代表终点)abcabcab**S*T假设现在在... 阅读全文
posted @ 2015-08-27 11:37 雪溯 阅读(165) 评论(0) 推荐(0)
摘要: https://leetcode.com/problems/add-two-numbers/You are given two linked lists representing two non-negative numbers. The digits are stored in reverse o... 阅读全文
posted @ 2015-08-27 10:45 雪溯 阅读(152) 评论(0) 推荐(0)
摘要: https://leetcode.com/problems/nth-highest-salary/ATTENTION:limit 子句只能接受int常量,不能接受运算式CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INTBEGINSET N =... 阅读全文
posted @ 2015-08-26 15:42 雪溯 阅读(224) 评论(0) 推荐(0)
摘要: https://leetcode.com/problems/second-highest-salary/Write a SQL query to get the second highest salary from theEmployeetable.+----+--------+| Id | Sal... 阅读全文
posted @ 2015-08-26 07:58 雪溯 阅读(155) 评论(0) 推荐(0)
摘要: https://leetcode.com/problems/combine-two-tables/Combine Two TablesTable: Person+-------------+---------+| Column Name | Type |+-------------+-----... 阅读全文
posted @ 2015-08-26 07:53 雪溯 阅读(337) 评论(0) 推荐(0)
摘要: https://leetcode.com/problems/two-sum/class Solution {public: vector twoSum(vector& nums, int target) { vector index(2,0); vector n2;... 阅读全文
posted @ 2015-08-25 18:12 雪溯 阅读(136) 评论(0) 推荐(0)
上一页 1 ··· 49 50 51 52 53 54 55 56 57 ··· 81 下一页