![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetcode
文章平均质量分 87
xiaohan_0212
这个作者很懒,什么都没留下…
展开
-
[leetcode]Merge k Sorted Lists
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. 这道题目在分布式系统中非常常见,来自不同client的sorted list要在central server上面merge起来。这个题目一般有两种做法,下面一一介绍并且分析复杂度。 第一种原创 2015-05-15 11:30:12 · 268 阅读 · 0 评论 -
[leetcode]Majority Element
Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. You may assume that the array is non-empty and the majority element原创 2015-05-14 19:49:52 · 211 阅读 · 0 评论 -
[leetcode]Excel Sheet Column Title
Given a positive integer, return its corresponding column title as appear in an Excel sheet. For example: 1 -> A 2 -> B 3 -> C ... 26 -> Z 27 -> AA 28 -> AB Credits原创 2015-05-14 19:42:09 · 221 阅读 · 0 评论 -
[leetcode]Excel Sheet Column Number
Related to question Excel Sheet Column Title Given a column title as appear in an Excel sheet, return its corresponding column number. For example: A -> 1 B -> 2 C -> 3 ... Z ->原创 2015-05-14 17:31:40 · 186 阅读 · 0 评论 -
[leetcode]Compare Version Numbers
Compare two version numbers version1 and version2. If version1 > version2 return 1, if version1 version2 return -1, otherwise return 0. You may assume that the version strings are non-empty and原创 2015-05-14 17:03:38 · 278 阅读 · 0 评论 -
[leetcode]Dungeon Game
The demons had captured the princess (P) and imprisoned her in the bottom-right corner of a dungeon. The dungeon consists of M x N rooms laid out in a 2D grid. Our valiant knight (K) was initially p原创 2015-05-14 14:30:09 · 261 阅读 · 0 评论 -
[leetcode]Rotate Array
Rotate an array of n elements to the right by k steps. For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,1,2,3,4]. Note: Try to come up as many solutions as you原创 2015-05-14 14:00:57 · 256 阅读 · 0 评论 -
[leetcode]Decode Ways
A message containing letters from A-Z is being encoded to numbers using the following mapping: 'A' -> 1 'B' -> 2 ... 'Z' -> 26 Given an encoded message containing digits, determine the total numb原创 2015-05-15 10:23:20 · 236 阅读 · 0 评论 -
[leetcode]Course Schedule
There are a total of n courses you have to take, labeled from 0 to n - 1. Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expressed as原创 2015-05-15 17:21:48 · 310 阅读 · 0 评论 -
[leetcode]Factorial Trailing Zeroes
Note: Your solution should be in logarithmic time complexity.Credits:Special thanks to @ts for adding this problem and creating all test cases.Hide Tags MathHave you met this question in a real interv原创 2015-05-14 14:39:37 · 248 阅读 · 0 评论