
新发现
peace in mind
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
[leetcode] Summary Ranges
题目链接在此 Given a sorted integer array without duplicates, return the summary of its ranges. For example, given [0,1,2,4,5,7], return ["0->2","4->5","7"]. 题目意思就是把连续的递增1的子序列义字符串的形式表示出来。并不是很难,原创 2015-08-05 15:49:47 · 336 阅读 · 0 评论 -
C++ map和set中的结构体
哇,好久没来写博客了。 今天是发现了一个新大陆。 是这样的,我想随机生成一些整数对(x,y),然后需要判断一堆数在之前又没生成过。直观的做法是弄一个bool型的二维数组,但是这样太耗费空间了,容易造成浪费。于是我们想把每个整数对放在一个结构体里,然后将结构体作为map的key,将一个bool型作为map的value。这样建立一个映射的关系,来判断整数对是否出现过。 于是一开始我就这样原创 2015-12-29 22:01:56 · 2077 阅读 · 0 评论 -
[LeetCode] Next Greater Element I
题目链接在此 You are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of nums2. Find all the next greater numbers for nums1's elements in the correspondin原创 2017-02-16 23:33:09 · 390 阅读 · 0 评论 -
[Leetcode] Rotate Image
题目链接在此 You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise). Follow up: Could you do this in-place? 把一个n x n的2D矩阵逆时针旋转90度,不用额外空间。原创 2017-03-13 04:00:29 · 339 阅读 · 0 评论 -
[Leetcode] Sum Root to Leaf Numbers
题目链接在此 Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number. An example is the root-to-leaf path 1->2->3 which represents the number 123. Fin原创 2017-03-14 20:11:00 · 462 阅读 · 0 评论