- 博客(6)
- 资源 (3)
- 收藏
- 关注
转载 leetcode Patching Array
题意:给定一个数组nums和一个数n,求添加最少的数使得[1,n]中的每个数都可以由数组中元素和组成用known_sum表示已知的连续和为[1,known_sum),有了这个表示那就简单了: nums[i] nums[i] > known_sum, 添加known_sum进数组才能达到最大的范围,所以已知范围更新为:[1,known_sum *2 )
2016-01-27 20:07:29 1908
转载 leetcode Longest Increasing Path in a Matrix
题意:给定一个矩阵,在里面找出最大上升路径 int dx[] = { 1 , -1, 0 , 0 }; int dy[] = { 0 , 0 , 1 , -1 }; class Solution { public: int dfs(int x, int y, const int &m,const int &n,vector>& matrix, vector>& dis) { if (di
2016-01-20 18:34:35 1281
转载 leetcode Odd Even Linked List
Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the value in the nodes. You should try to do it in
2016-01-16 13:09:36 749
转载 leetcode Count of Range Sum
Given an integer array nums, return the number of range sums that lie in [lower, upper] inclusive. Range sum S(i, j) is defined as the sum of the elements in nums between indices i and j (i ≤ j),
2016-01-11 09:48:25 3224
转载 leetcode Power of Three
Given an integer, write a function to determine if it is a power of three. Follow up: Could you do it without using any loop / recursion? 方法一: class Solution { public: bool isPowerOfTh
2016-01-08 14:20:22 1359
转载 leetcode Wiggle Sort II
Given an unsorted array nums, reorder it such that nums[0] nums[2] . Example: (1) Given nums = [1, 5, 1, 1, 6, 4], one possible answer is [1, 4, 1, 5, 1, 6]. (2) Given nums = [1, 3, 2, 2, 3
2016-01-01 11:23:43 2793
Twitter Data Analytics
2015-10-23
ADT-22.0.1 安卓开发工具
2014-07-07
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人