摘要: Given a non-empty array of integers, return the k most frequent elements.Example 1:Input: nums = [1,1,1,2,2,3], k = 2Output: [1,2]Example 2:Input: num 阅读全文
posted @ 2018-10-03 15:04 jasminemzy 阅读(180) 评论(0) 推荐(0) 编辑
摘要: Given a robot cleaner in a room modeled as a grid.Each cell in the grid can be empty or blocked.The robot cleaner with 4 given APIs can move forward, 阅读全文
posted @ 2018-10-03 14:17 jasminemzy 阅读(726) 评论(0) 推荐(0) 编辑
摘要: Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x.You should preserve the o 阅读全文
posted @ 2018-10-03 13:05 jasminemzy 阅读(110) 评论(0) 推荐(0) 编辑
摘要: Given a sorted array of integers nums and integer values a, b and c. Apply a quadratic function of the form f(x) = ax2 + bx + c to each element x in t 阅读全文
posted @ 2018-10-03 12:47 jasminemzy 阅读(139) 评论(0) 推荐(0) 编辑
摘要: Given a C++ program, remove comments from it. The program source is an array where source[i] is the i-th line of the source code. This represents the 阅读全文
posted @ 2018-10-03 11:17 jasminemzy 阅读(236) 评论(0) 推荐(0) 编辑
摘要: You are given a list of non-negative integers, a1, a2, ..., an, and a target, S. Now you have 2 symbols + and -. For each integer, you should choose o 阅读全文
posted @ 2018-10-03 10:03 jasminemzy 阅读(226) 评论(0) 推荐(0) 编辑