上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 40 下一页
摘要: 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 [1,2]. Note: You may assum 阅读全文
posted @ 2017-02-19 19:27 amazingzoe 阅读(144) 评论(0) 推荐(0) 编辑
摘要: Given n nodes labeled from 0 to n - 1 and a list of undirected edges (each edge is a pair of nodes), write a function to find the number of connected 阅读全文
posted @ 2017-02-19 19:17 amazingzoe 阅读(176) 评论(0) 推荐(0) 编辑
摘要: Given two 1d vectors, implement an iterator to return their elements alternately. For example, given two 1d vectors: By calling next repeatedly until  阅读全文
posted @ 2017-02-19 17:44 amazingzoe 阅读(161) 评论(0) 推荐(0) 编辑
摘要: Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements 阅读全文
posted @ 2017-02-19 17:32 amazingzoe 阅读(114) 评论(0) 推荐(0) 编辑
摘要: Given a string, sort it in decreasing order based on the frequency of characters. Example 1: Input: "tree" Output: "eert" Explanation: 'e' appears twi 阅读全文
posted @ 2017-02-19 16:36 amazingzoe 阅读(147) 评论(0) 推荐(0) 编辑
摘要: Given a nested list of integers, return the sum of all integers in the list weighted by their depth. Each element is either an integer, or a list -- w 阅读全文
posted @ 2017-02-17 23:58 amazingzoe 阅读(136) 评论(0) 推荐(0) 编辑
摘要: Given two sparse matrices A and B, return the result of AB. You may assume that A's column number is equal to B's row number. Example: 阅读全文
posted @ 2017-02-17 23:16 amazingzoe 阅读(130) 评论(0) 推荐(0) 编辑
摘要: A group of two or more people wants to meet and minimize the total travel distance. You are given a 2D grid of values 0 or 1, where each 1 marks the h 阅读全文
posted @ 2017-02-17 22:55 amazingzoe 阅读(200) 评论(0) 推荐(0) 编辑
摘要: Given a non-empty integer array, find the minimum number of moves required to make all array elements equal, where a move is incrementing a selected e 阅读全文
posted @ 2017-02-17 22:34 amazingzoe 阅读(124) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers, 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements that appear twi 阅读全文
posted @ 2017-02-17 22:08 amazingzoe 阅读(159) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 40 下一页