码迷,mamicode.com
首页 >  
搜索关键字:solution upgrade    ( 13024个结果
LeetCode: 几数之和题解总结(双指针算法)
1 两数之和 直接n平方复杂度,双指针减少一层复杂度; 或者可以采用哈希表 class Solution { public: vector<int> twoSum(vector<int>& nums, int target) { unordered_map<int, int> heap; for(i ...
分类:编程语言   时间:2020-12-25 11:48:25    阅读次数:0
seeyou 致远OA 任意文件上传
访问:http://xxxx/seeyon/htmlofficeservlet,看到 POC: POST /seeyon/htmlofficeservlet HTTP/1.1 Host: x.x.x.x Cache-Control: max-age=0 Upgrade-Insecure-Reques ...
分类:Web程序   时间:2020-12-25 11:46:31    阅读次数:0
leetcode1219
原地交换: 思路很简单先对角线对称交换,再左右对称交换就可以得到旋转90度。 线性代数证明方法:等我复习完orz class Solution { public: void rotate(vector<vector<int>>& matrix) { int n = matrix.size(); fo ...
分类:其他好文   时间:2020-12-24 11:57:41    阅读次数:0
[leetcode/lintcode 题解] Amazon 面试题:迷你推特
实现一个迷你的推特,支持下列几种方法 ?postTweet(user_id, tweet_text).? 发布一条推特. ?getTimeline(user_id).? 获得给定用户最新发布的十条推特,按照发布时间从最近的到之前排序 ?getNewsFeed(user_id).? 获得给定用户的朋友 ...
分类:其他好文   时间:2020-12-23 12:31:01    阅读次数:0
LeetCode71. 简化路径
☆☆思路:使用字符串的split方法,以'/'为分隔符区分字符,然后逐步识别符号'..'与字母,'.'可以直接忽略,还需要注意空的情况。 class Solution { public String simplifyPath(String path) { // 需要注意连着的// 分出来是空 Str ...
分类:其他好文   时间:2020-12-23 12:19:58    阅读次数:0
LeetCode20. 有效的括号
class Solution { public boolean isValid(String s) { if (s == null || s.length() == 0) return true; /** * 解法1: */ /*Stack<Character> stack = new Stack< ...
分类:其他好文   时间:2020-12-23 12:12:30    阅读次数:0
剑指 Offer 49. 丑数
//动态规划 class Solution { public int nthUglyNumber(int n) { //定义一个数组dp,来按序存放丑数 int[] dp = new int[n]; //第一个丑数是1 dp[0] = 1; //分别定义由质因子 2,3,5 乘以较小丑数得到的下标索 ...
分类:其他好文   时间:2020-12-21 12:11:13    阅读次数:0
完全平方数
复习bfs 这题我们用bfs 做 class Solution { public: int numSquares(int n) { queue <int> q; vector <int> dist(n+1,INT_MAX); q.push(0); dist[0] = 0; while(q.size( ...
分类:其他好文   时间:2020-12-21 12:01:05    阅读次数:0
剑指 Offer 13. 机器人的运动范围
题目描述: 地上有一个m行n列的方格,从坐标 [0,0] 到坐标 [m-1,n-1] 。一个机器人从坐标 [0, 0] 的格子开始移动,它每次可以向左、右、上、下移动一格(不能移动到方格外),也不能进入行坐标和列坐标的数位之和大于k的格子。例如,当k为18时,机器人能够进入方格 [35, 37] , ...
分类:其他好文   时间:2020-12-21 11:27:34    阅读次数:0
leetcode_面试题 01.08. 零矩阵
编写一种算法,若M × N矩阵中某个元素为0,则将其所在的行与列清零。 示例 1: 输入: [ [1,1,1], [1,0,1], [1,1,1] ] 输出: [ [1,0,1], [0,0,0], [1,0,1] ] 示例 2: 输入: [ [0,1,2,0], [3,4,5,2], [1,3,1 ...
分类:其他好文   时间:2020-12-21 11:05:10    阅读次数:0
13024条   上一页 1 ... 33 34 35 36 37 ... 1303 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!