摘要: 暴力解法:1:在n个数中间加逗号2:给第一步产生的字符串加小数点(并判断合法),下面是判断规则if S == "": return []if S == "0": return [S]if S == "0XXX0"... 阅读全文
posted @ 2019-02-27 22:39 开局一把刀 阅读(2) 评论(0) 推荐(0)
摘要: 暴力解法:1:在n个数中间加逗号2:给第一步产生的字符串加小数点(并判断合法),下面是判断规则if S == "": return []if S == "0": return [S]if S == "0XXX0"... 阅读全文
posted @ 2019-02-27 22:39 开局一把刀 阅读(4) 评论(0) 推荐(0)
摘要: 暴力解法:1:在n个数中间加逗号2:给第一步产生的字符串加小数点(并判断合法),下面是判断规则if S == "": return []if S == "0": return [S]if S == "0XXX0"... 阅读全文
posted @ 2019-02-27 22:39 开局一把刀 阅读(7) 评论(0) 推荐(0)
摘要: 给定一个只包括 '(',')','{','}','[',']' 的字符串,判断字符串是否有效。有效字符串需满足:左括号必须用相同类型的右括号闭合。 左括号必须以正确的顺序闭合。注意空字符串可被认为是有效字符串。示... 阅读全文
posted @ 2019-02-27 22:37 开局一把刀 阅读(5) 评论(0) 推荐(0)
摘要: 给定一个只包括 '(',')','{','}','[',']' 的字符串,判断字符串是否有效。有效字符串需满足:左括号必须用相同类型的右括号闭合。 左括号必须以正确的顺序闭合。注意空字符串可被认为是有效字符串。示... 阅读全文
posted @ 2019-02-27 22:37 开局一把刀 阅读(4) 评论(0) 推荐(0)
摘要: 给定一个只包括 '(',')','{','}','[',']' 的字符串,判断字符串是否有效。有效字符串需满足:左括号必须用相同类型的右括号闭合。 左括号必须以正确的顺序闭合。注意空字符串可被认为是有效字符串。示... 阅读全文
posted @ 2019-02-27 22:37 开局一把刀 阅读(2) 评论(0) 推荐(0)
摘要: class Solution {public: bool wordPattern(string ptn, string str) { vector words=split(str); ... 阅读全文
posted @ 2019-02-27 22:34 开局一把刀 阅读(3) 评论(0) 推荐(0)
摘要: class Solution {public: bool wordPattern(string ptn, string str) { vector words=split(str); ... 阅读全文
posted @ 2019-02-27 22:34 开局一把刀 阅读(1) 评论(0) 推荐(0)
摘要: class Solution {public: bool wordPattern(string ptn, string str) { vector words=split(str); ... 阅读全文
posted @ 2019-02-27 22:34 开局一把刀 阅读(4) 评论(0) 推荐(0)
摘要: #include #include #include #include #include using namespace std;struct cmp{ /*在左边(也就是队尾),优先级越低 * 默... 阅读全文
posted @ 2019-02-27 22:33 开局一把刀 阅读(9) 评论(0) 推荐(0)
摘要: #include #include #include #include #include using namespace std;struct cmp{ /*在左边(也就是队尾),优先级越低 * 默... 阅读全文
posted @ 2019-02-27 22:33 开局一把刀 阅读(2) 评论(0) 推荐(0)
摘要: #include #include #include #include #include using namespace std;struct cmp{ /*在左边(也就是队尾),优先级越低 * 默... 阅读全文
posted @ 2019-02-27 22:33 开局一把刀 阅读(3) 评论(0) 推荐(0)
摘要: 一def lower_bound(array, first, last, value): # 返回[first, last)内第一个不小于value的值的位置 while first = target) ... 阅读全文
posted @ 2019-02-27 22:28 开局一把刀 阅读(5) 评论(0) 推荐(0)
摘要: 一def lower_bound(array, first, last, value): # 返回[first, last)内第一个不小于value的值的位置 while first = target) ... 阅读全文
posted @ 2019-02-27 22:28 开局一把刀 阅读(5) 评论(0) 推荐(0)
摘要: 一def lower_bound(array, first, last, value): # 返回[first, last)内第一个不小于value的值的位置 while first = target) ... 阅读全文
posted @ 2019-02-27 22:28 开局一把刀 阅读(4) 评论(0) 推荐(0)
摘要: 给定两个单词 word1 和 word2,计算出将 word1 转换成 word2 所使用的最少操作数 。你可以对一个单词进行如下三种操作: 插入一个字符 删除一个字符 替换一个字符 思路:动态规划m n... 阅读全文
posted @ 2019-02-27 22:26 开局一把刀 阅读(5) 评论(0) 推荐(0)
摘要: 给定两个单词 word1 和 word2,计算出将 word1 转换成 word2 所使用的最少操作数 。你可以对一个单词进行如下三种操作: 插入一个字符 删除一个字符 替换一个字符 思路:动态规划m n... 阅读全文
posted @ 2019-02-27 22:26 开局一把刀 阅读(2) 评论(0) 推荐(0)
摘要: 给定两个单词 word1 和 word2,计算出将 word1 转换成 word2 所使用的最少操作数 。你可以对一个单词进行如下三种操作: 插入一个字符 删除一个字符 替换一个字符 思路:动态规划m n... 阅读全文
posted @ 2019-02-27 22:26 开局一把刀 阅读(4) 评论(0) 推荐(0)
摘要: 给定一个由 0 和 1 组成的矩阵,找出每个元素到最近的 0 的距离。两个相邻元素间的距离为 1 。示例 1: 输入:0 0 00 1 00 0 0输出:0 0 00 1 00 0 0示例 2: 输入:0 0 0... 阅读全文
posted @ 2019-02-27 22:20 开局一把刀 阅读(5) 评论(0) 推荐(0)
摘要: 给定一个由 0 和 1 组成的矩阵,找出每个元素到最近的 0 的距离。两个相邻元素间的距离为 1 。示例 1: 输入:0 0 00 1 00 0 0输出:0 0 00 1 00 0 0示例 2: 输入:0 0 0... 阅读全文
posted @ 2019-02-27 22:20 开局一把刀 阅读(9) 评论(0) 推荐(0)