- 博客(5)
- 收藏
- 关注
原创 最长上升子序列
300. 最长上升子序列https://leetcode-cn.com/problems/longest-increasing-subsequence/class Solution { public int lengthOfLIS(int[] nums) { if(nums == null || nums.length == 0) return 0; int n = nums.length; int[] dp = new int[n];
2020-07-26 18:18:17
73
原创 回溯法
39. 组合总和https://leetcode-cn.com/problems/combination-sum/class Solution { public List<List<Integer>> combinationSum(int[] candidates, int target) { List<List<Integer>> list = new ArrayList<>(); if(candida
2020-07-25 21:54:05
84
原创 美团点评2020校招数据分析方向笔试题
[编程题]寻找最后的山峰热度指数:1319时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 256M,其他语言512M 算法知识视频讲解山峰元素是指其值大于或等于左右相邻值的元素。给定一个输入数组nums,任意两个相邻元素值不相等,数组可能包含多个山峰。找到索引最大的那个山峰元素并返回其索引。假设 nums[-1] = nums[n] = -∞。输入描述: 在命令行中输入一行数字,数字之间以空格分割,遇到换行符结束。输入的数字为整型,且总数量在10万以内。输出描述:输出索引最大的山
2020-07-23 21:13:43
1317
原创 ubuntu16.04LTS Caffe(CPU版本) opencv openpsoe安装
Caffe(CPU版本)安装1.安装caffe依赖包$sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler$ sudo apt-get install --no-install-recommends libboos...
2019-04-19 20:20:18
437
2
原创 Leetcode 279. 完全平方数
给定正整数 n,找到若干个完全平方数(比如 1, 4, 9, 16, …)使得它们的和等于 n。你需要让组成和的完全平方数的个数最少。示例 1:输入: n = 12输出: 3解释: 12 = 4 + 4 + 4.示例 2:输入: n = 13输出: 2解释: 13 = 4 + 9.动态规划解法int numSquares(int n) { vector<...
2019-04-19 20:00:43
141
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人