上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 30 下一页
摘要: /** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ 阅读全文
posted @ 2020-05-15 10:11 弓呆的胖次 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 思路,首先,用函数去掉除了大小字母,数字之外的东西,用“”代替。 此外,要全部转换成小写, 之后双指针一前一后遍历就行 class Solution { public boolean isPalindrome(String s) {//大小写转换,看笔记 if(s.length()==0||s==n 阅读全文
posted @ 2020-05-15 09:51 弓呆的胖次 阅读(319) 评论(0) 推荐(0) 编辑
摘要: 作者:BuRNIngsuperman链接:https://www.nowcoder.com/discuss/425253来源:牛客网 实习简历投的晚,笔试四月初就完成,一直没有面试。可能原部门没有hc,期间还收到一次问我要不要转前端的电话,被我拒绝了。然后4月底收到美团金融的面试邀请。 第一面5.6 阅读全文
posted @ 2020-05-14 17:07 弓呆的胖次 阅读(409) 评论(0) 推荐(0) 编辑
摘要: https://blog.csdn.net/ye17186/article/details/89467919 阅读全文
posted @ 2020-05-14 15:21 弓呆的胖次 阅读(154) 评论(0) 推荐(0) 编辑
摘要: https://github.com/CyC2018/CS-Notes/blob/master/notes/%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%BD%91%E7%BB%9C%20-%20%E4%BC%A0%E8%BE%93%E5%B1%82.md 阅读全文
posted @ 2020-05-14 15:07 弓呆的胖次 阅读(113) 评论(0) 推荐(0) 编辑
摘要: https://blog.csdn.net/a745233700/article/details/80977133 https://blog.csdn.net/a745233700/article/details/80959716 阅读全文
posted @ 2020-05-13 15:20 弓呆的胖次 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 思路:可以把交易日分为上涨交易日与下降交易日,假如今天比昨天贵,就叫上涨。用贪心策略,每个上涨交易日都买,下降交易日都不买 class Solution {//贪心策略,所有上涨交易日都买,所有下降交易日都不卖 public int maxProfit(int[] prices) { int len 阅读全文
posted @ 2020-05-13 10:57 弓呆的胖次 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 思路:可以找出数组里每一个元素右侧的最大值,再遍历整个数组,找当前元素右侧最大值和当前元素数值的差,最大的就是要求的结果。 class Solution { public int maxProfit(int[] prices) { int[] rightMax=new int[prices.leng 阅读全文
posted @ 2020-05-13 10:07 弓呆的胖次 阅读(147) 评论(0) 推荐(0) 编辑
摘要: https://leetcode-cn.com/problems/triangle/solution/zi-di-xiang-shang-dong-tai-gui-hua-lei-si-yu-cong-/ 思路: 以[[2],[3,4],[6,5,7],[4,1,8,3]]为例: 假设从倒数第二列开 阅读全文
posted @ 2020-05-13 09:20 弓呆的胖次 阅读(216) 评论(0) 推荐(0) 编辑
摘要: https://leetcode-cn.com/problems/lowest-common-ancestor-of-a-binary-tree/solution/236ti-er-cha-shu-de-zui-jin-gong-gong-zu-xian-by-i/ 最近公共祖先的定义: 设节点 r 阅读全文
posted @ 2020-05-11 08:53 弓呆的胖次 阅读(226) 评论(0) 推荐(0) 编辑
上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 30 下一页