![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode
文章平均质量分 64
霄月林语
这个作者很懒,什么都没留下…
展开
-
[LeetCode] Single Number
Title:Given an array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement it without u原创 2014-03-13 21:23:23 · 287 阅读 · 0 评论 -
[LeetCode] Multiply Strings
题目:Given two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be arbitrarily large and are non-negative.题解:原创 2014-07-24 00:27:55 · 317 阅读 · 0 评论 -
[LeetCode] Climbing Stairs
题目:You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?题解:可以由递推关系得出原创 2014-07-25 23:36:54 · 253 阅读 · 0 评论 -
[LeetCode] Longest Substring Without Repeating Characters
题目:Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length is原创 2014-07-24 00:36:49 · 349 阅读 · 0 评论 -
[LeetCode] Populating Next Right Pointers in Each Node
题目:Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate each next pointer to point to its next right原创 2014-07-25 22:20:27 · 214 阅读 · 0 评论 -
[LeetCode] Palindrome Number
class Solution {public: bool isPalindrome(int x) { if( x < 0 ) return false; int count = 1; int p = x; while( p/10 != 0){ count++; p /= 10; } for(int i = 0; i < count/原创 2014-05-26 14:30:44 · 280 阅读 · 0 评论 -
[LeetCode] Swap Nodes in Pairs
题目:Given a linked list, swap every two adjacent nodes and return its head.For example,Given 1->2->3->4, you should return the list as 2->1->4->3.Your algorithm should use only constant原创 2014-07-26 00:33:55 · 291 阅读 · 0 评论 -
[LeetCode] LRU Cache
题目:Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set.get(key) - Get the value (will always be positive) of th原创 2014-08-02 21:58:35 · 278 阅读 · 0 评论 -
[LeetCode] Sqrt(x)
题目:Implement int sqrt(int x).Compute and return the square root of x.原创 2014-07-28 18:45:16 · 323 阅读 · 0 评论