
数据结构和算法
SwellWu
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
reverse string
344 reverse string cppclass Solution { public: string reverseString(string s) { reverse(s.begin(),s.end()); return s; } };pythonclass Solution(object): def reverseString(sel原创 2016-05-10 00:38:41 · 484 阅读 · 0 评论 -
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 [1,2].Note: You may assume k is always valid, 1 ≤ k ≤ number of unique原创 2016-05-20 11:38:57 · 408 阅读 · 0 评论 -
Intersection of Two Arrays
Given two arrays, write a function to compute their intersection.Example: Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2].Note: Each element in the result must be unique. The result can be in an原创 2016-05-20 10:26:25 · 400 阅读 · 0 评论