1. https://leetcode-cn.com/problems/container-with-most-water/ 思想:左右边界 i,j 向中间收敛 ,左右夹逼 方法一: 一维数组的坐标变换 i,j 枚举:left bar,right bar. (x-y)*height_diff cla ...
分类:
其他好文 时间:
2020-02-25 17:25:26
阅读次数:
67
Scientists say a lot about the problems of global warming and cooling of the Earth. Indeed, such natural phenomena strongly influence all life on our ...
分类:
其他好文 时间:
2020-02-25 12:58:14
阅读次数:
90
链接:https://leetcode-cn.com/problems/he-bing-liang-ge-pai-xu-de-lian-biao-lcof/ 代码: /** * Definition for singly-linked list. * struct ListNode { * int ...
分类:
编程语言 时间:
2020-02-24 18:35:13
阅读次数:
72
Is there a difference in database ordering between the cloud and the ground? When I was dealing with database ordering before, I published an article ...
分类:
数据库 时间:
2020-02-24 13:31:51
阅读次数:
88
题目:给你一个字符串 s ,它只包含三种字符 a, b 和 c 。请你返回 a,b 和 c 都 至少 出现过一次的子字符串数目。 链接:https://leetcode-cn.com/problems/number-of-substrings-containing-all-three-charact ...
分类:
其他好文 时间:
2020-02-24 13:25:11
阅读次数:
79
Leetcode: "110. 平衡二叉树" Leetcode: "110. 平衡二叉树" 点链接就能看到原题啦~ 关于AVL的判断函数写法,请跳转: "平衡二叉树的判断" 废话不说直接上代码吧~主要的解析的都在上面的链接里了 自顶向下写法 ...
分类:
其他好文 时间:
2020-02-24 09:23:09
阅读次数:
64
题目:https://leetcode-cn.com/problems/is-subsequence/ 给定字符串 s 和 t ,判断 s 是否为 t 的子序列。 你可以认为 s 和 t 中仅包含英文小写字母。字符串 t 可能会很长(长度 ~= 500,000),而 s 是个短字符串(长度 <=10 ...
分类:
其他好文 时间:
2020-02-24 09:18:27
阅读次数:
76
原题链接https://pintia.cn/problem-sets/14/problems/797 这题一开始考虑时犯了一些错误,一开始是这样考虑的,按题目的意思,每2分钟蠕虫爬行的距离是(U-D)寸。那么平均每分钟爬行的距离是(U-D+1)/2寸。然后对照样例数据N=12,U=3,D=1算出需要 ...
分类:
其他好文 时间:
2020-02-24 00:11:39
阅读次数:
95
题目:给定一个 n 个元素有序的(升序)整型数组 nums 和一个目标值 target ,写一个函数搜索 nums 中的 target,如果目标值存在返回下标,否则返回 -1。链接:https://leetcode-cn.com/problems/binary-search 法一:参考别人写的两种方 ...
分类:
其他好文 时间:
2020-02-23 22:29:31
阅读次数:
63
请实现一个函数,把字符串 s 中的每个空格替换成"%20"。 示例 1: 输入:s = "We are happy."输出:"We%20are%20happy." 来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/ti-huan-kong-ge-l ...
分类:
其他好文 时间:
2020-02-23 21:58:21
阅读次数:
62