随笔分类 -  Leetcode

Leetcode - 动态规划总结(必看!!!)
摘要:一、labuladong动态规划模板思路 wiki:https://labuladong.gitee.io/algo/di-ling-zh-bfe1b/dong-tai-g-1e688/ 题目: 动态规划模板思路: 二、我自己如何理解【状态】【选择】 以714题目《最佳时机去买卖股票+手续费》为例子 阅读全文

posted @ 2023-07-12 16:47 frank_cui 阅读(33) 评论(0) 推荐(0) 编辑

Leetcode - 分类经典题目汇总
摘要:回溯算法 动态规划 通解通法 动态规划问题的一般形式就是求最值 判断算法问题是否具备「最优子结构」,是否能够通过子问题的最值得到原问题的最值 明确 base case -> 明确「状态」-> 明确「选择」 -> 定义 dp 数组/函数的含义 「状态」就是指,f(n) 把参数 n 想做一个状态,这个状 阅读全文

posted @ 2023-06-14 11:27 frank_cui 阅读(92) 评论(0) 推荐(0) 编辑

Goldman Sachs
摘要:https://medium.com/@hch.hkcontact/goldman-sachs-top-50-leetcode-questions-q7-high-five-a933247c219a Coderpad describe how to implement HashMap Impleme 阅读全文

posted @ 2021-01-19 20:36 frank_cui 阅读(882) 评论(0) 推荐(0) 编辑

Leetcode - 模板思路+易错点
摘要:模板 数组里找超过1/2,1/3个数的数字 通解通法:摩尔投票法 一个数组,超过1/2的数字,至多有1个;超过1/3的数字,至多有2个... 超过1/2: 169. 多数元素 超过1/3:229. 求众数 II 疑问:最后留下的一定是超过1/2,或者1/3么? https://leetcode-cn 阅读全文

posted @ 2019-12-31 16:42 frank_cui 阅读(533) 评论(0) 推荐(0) 编辑

Leetcode - K Sum
摘要:List<List<Integer>> kSum_Trim(int[] a, int target, int k) { List<List<Integer>> result = new ArrayList<>(); if (a == null || a.length < k || k < 2) return result; Arrays.sort(a); kSum_Trim(a, target, 阅读全文

posted @ 2019-09-18 23:20 frank_cui 阅读(176) 评论(0) 推荐(0) 编辑

Leetcode - 238. Product of Array Except Self
摘要:题目Given an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all the elements of nums excep 阅读全文

posted @ 2019-03-24 18:03 frank_cui 阅读(107) 评论(0) 推荐(0) 编辑

Leetcode - 110 判断二叉树是否为平衡二叉树
摘要:110. Balanced Binary Tree Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as: a bi 阅读全文

posted @ 2019-03-17 23:11 frank_cui 阅读(246) 评论(0) 推荐(0) 编辑

Leetcode - 213. House Robber II
摘要:URL: https://leetcode.com/problems/house-robber-ii/ You are a professional robber planning to rob houses along a street. Each house has a certain amou 阅读全文

posted @ 2019-03-05 23:34 frank_cui 阅读(102) 评论(0) 推荐(0) 编辑

Leetcode - 198. House Robber
摘要:URL : https://leetcode.com/problems/house-robber/ You are a professional robber planning to rob houses along a street. Each house has a certain amount 阅读全文

posted @ 2019-03-05 22:52 frank_cui 阅读(146) 评论(0) 推荐(0) 编辑

Leetcode - 189. Rotate Array
摘要:url: https://leetcode.com/problems/rotate-array/ Given an array, rotate the array to the right by k steps, where k is non-negative. Example 1: Example 阅读全文

posted @ 2019-03-05 13:05 frank_cui 阅读(124) 评论(0) 推荐(0) 编辑

< 2025年2月 >
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 1
2 3 4 5 6 7 8

导航

统计

levels of contents
点击右上角即可分享
微信分享提示