开始了一个LeetCode题目的进度

上传到Github

pycharm上传到github:https://blog.csdn.net/zha6476003/article/details/83052032

GitHub项目查看:https://github.com/WinterStarHu/LeetCode

遇到的一个问题:Permanently added the RSA host key for IP address '13.250.177.223' to t he list of known hosts.
解决方法:https://blog.csdn.net/yushuangping/article/details/84240863

使用LeetCode插件

Leetcode editor
IDE 刷题工具 leetcode editor介绍
LeetCode editor本地调试

可以自定义模板


如上是我自定义的模板


得到的结果如上

enumerate

使用enumerate() 可以很好的提高运行速度
如下两数相加的例子中,可以大大提高运行速度,当然这少不了哈希表的配合

# leetcode submit region begin(Prohibit modification and deletion)
class Solution(object):
    def twoSum(self, nums, target):
        hashmap = {}
        for ind, num in enumerate(nums):
            hashmap[num] = ind
        for i, num in enumerate(nums):
            j = hashmap.get(target - num)
            if j is not None and i != j:
                return [i, j]
# leetcode submit region end(Prohibit modification and deletion)