摘要:
题目:Top K Frequent Elements Given a non-empty array of integers, return the k most frequent elements. For example,Given [1,1,1,2,2,3] and k = 2, return 阅读全文
摘要:
题目:Reverse String Write a function that takes a string as input and returns the string reversed. Example:Given s = "hello", return "olleh". 题意:逆置字符串 思 阅读全文
摘要:
题目:Integer Break Given a positive integer n, break it into the sum of at least two positive integers and maximize the product of those integers. Retur 阅读全文
摘要:
题目:Power of Two Given an integer, write a function to determine if it is a power of two. 题意:判断一个数是否是2的k次方数。 思路: 2的次方数使用2进制表示则必然只有最高位是1其他都是0; 这样判断一个数最多 阅读全文
摘要:
题目:Palindrome Pairs Given a list of unique words, find all pairs of distinct indices (i, j) in the given list, so that the concatenation of the two wo 阅读全文