摘要: Given an array nums and a target value k, find the maximum length of a subarray that sums to k. If there isn't one, return 0 instead. Example 1: Given 阅读全文
posted @ 2018-10-09 14:21 轻风舞动 阅读(1612) 评论(0) 推荐(0) 编辑
摘要: In an election, the i-th vote was cast for persons[i] at time times[i]. Now, we would like to implement the following query function: TopVotedCandidat 阅读全文
posted @ 2018-10-09 04:47 轻风舞动 阅读(1347) 评论(0) 推荐(0) 编辑
摘要: Design an algorithm to encode a list of strings to a string. The encoded string is then sent over the network and is decoded back to the original list 阅读全文
posted @ 2018-10-09 02:40 轻风舞动 阅读(866) 评论(0) 推荐(0) 编辑
摘要: Write a program to find the nth super ugly number. Super ugly numbers are positive numbers whose all prime factors are in the given prime list primes  阅读全文
posted @ 2018-10-09 02:24 轻风舞动 阅读(1322) 评论(0) 推荐(0) 编辑
摘要: Write a program to find the n-th ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. Example: Note: 新题中没有提示,老版的有。 阅读全文
posted @ 2018-10-09 02:13 轻风舞动 阅读(442) 评论(0) 推荐(0) 编辑
摘要: Write a program to check whether a given number is an ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. Example 阅读全文
posted @ 2018-10-09 02:02 轻风舞动 阅读(392) 评论(0) 推荐(0) 编辑