上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 44 下一页
摘要: 问题: 给定一组[start, end]表示气球左右边界的气球数组,求最少射多少箭,能将所有气球射爆。 射箭位置X,start<=X<=end,则能射破该气球。 Example: Input: [[10,16], [2,8], [1,6], [7,12]] Output: 2 Explanation 阅读全文
posted @ 2020-09-13 11:01 habibah_chang 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 问题: 给定一组[start, end]的区间数组,求其间最少去掉多少个区间,可使得剩下的区间互不重叠。 ⚠️ 注意:[1,2][2,3]这样:前一个区间end=后一个区间start,的两个区间也不重叠。 Example 1: Input: [[1,2],[2,3],[3,4],[1,3]] Out 阅读全文
posted @ 2020-09-13 10:19 habibah_chang 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 参考:https://labuladong.gitbook.io/algo/dong-tai-gui-hua-xi-lie/dong-tai-gui-hua-zhi-kmp-zi-fu-pi-pei-suan-fa 问题:实现strstr,求是否为子串,若是,返回子串所在第一个字符的index,否则 阅读全文
posted @ 2020-09-12 14:30 habibah_chang 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 问题: 给定一个字符串s,和一个模式串p,求p是否能匹配s 正则表达支持以下两种符号 '.' Matches any single character. '*' Matches zero or more of the preceding element. Note: s could be empty 阅读全文
posted @ 2020-09-10 19:11 habibah_chang 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 参考:https://labuladong.gitbook.io/algo/dong-tai-gui-hua-xi-lie/dong-tai-gui-hua-zhi-bo-yi-wen-ti 问题: 给定一堆石子的得分。A和B两个人进行如下游戏, 轮流,从石堆的两边选择一个石子,最终获得得分最大的人 阅读全文
posted @ 2020-09-10 11:42 habibah_chang 阅读(97) 评论(0) 推荐(0) 编辑
摘要: 问题: 给定一个字符串,求其中最长回文子序列(子序列不是连续字符串)的长度。 Example 1: Input: "bbbab" Output: 4 One possible longest palindromic subsequence is "bbbb". Example 2: Input: " 阅读全文
posted @ 2020-09-06 16:57 habibah_chang 阅读(98) 评论(0) 推荐(0) 编辑
摘要: 问题: 给定两个字符串,求他们的最长公共子序列的长度。 Example 1: Input: text1 = "abcde", text2 = "ace" Output: 3 Explanation: The longest common subsequence is "ace" and its le 阅读全文
posted @ 2020-09-06 15:26 habibah_chang 阅读(235) 评论(0) 推荐(0) 编辑
摘要: 参考:https://mp.weixin.qq.com/s/I0yo0XZamm-jMpG-_B3G8g 问题: 给定一组气球藏有的金币数。若戳破一个气球,则可得其相邻两个气球和自己藏有金币之积。 求按一定顺序戳破气球,最终能获得最多金币是多少。 Note: You may imagine nums 阅读全文
posted @ 2020-09-05 17:03 habibah_chang 阅读(208) 评论(0) 推荐(0) 编辑
摘要: 参考:https://labuladong.gitbook.io/algo/dong-tai-gui-hua-xi-lie/zhuang-tai-ya-suo-ji-qiao 问题: 给定两个字符串,求出由一个字符串转化为另一个字符串的最短编辑距离。(编辑操作次数) 有以下三种编辑: 插入 删除 替 阅读全文
posted @ 2020-09-05 15:14 habibah_chang 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 问题: 给定一组硬币面值coins,和一个总价amount 求用给定面值硬币中,有多少种构成方法能构成总价。 Example 1: Input: amount = 5, coins = [1, 2, 5] Output: 4 Explanation: there are four ways to m 阅读全文
posted @ 2020-08-31 19:26 habibah_chang 阅读(144) 评论(0) 推荐(0) 编辑
上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 44 下一页