Leetcode
文章平均质量分 81
liubai01
上海科技大学CS本科毕业。目前纽约大学Courant计算机科学硕士在读。
个人主页:http://www.liubai01.cn
展开
-
Leetcode264答案与解析 - Ugly Number II
原题 Leetcode原题传送门 Write a program to find the n-th ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. Example: Input: n = 10 Output: 12 Explanation: 1, 2, 3,...原创 2018-09-16 17:10:04 · 1474 阅读 · 0 评论 -
Leetcode841答案与解析 - Keys and Rooms(cpp)
原题 Leetcode原题传送门 There are N rooms and you start in room 0. Each room has a distinct number in 0, 1, 2, ..., N-1, and each room may have some keys to access the next room. Formally, each room i h...原创 2018-09-23 19:48:03 · 343 阅读 · 0 评论 -
Leetcode23答案与解析 - Merge k Sorted Lists(cpp)
原题 Leetcode原题传送门 Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. Example: Input: [ 1->4->5, 1->3->4, 2->6 ] Output: 1->1...原创 2018-09-20 16:40:57 · 190 阅读 · 0 评论 -
Leetcode4答案与解析 - Median of Two Sorted Arrays(python)
原题 Leetcode原题传送门 There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)). You may...原创 2018-10-14 22:30:39 · 446 阅读 · 0 评论