LeetCode
文章平均质量分 56
ChaoFeiLi
这个作者很懒,什么都没留下…
展开
-
LeetCode —— [94. 二叉树的中序遍历]
https://leetcode-cn.com/problems/binary-tree-inorder-traversal/solution/shou-hua-tu-jie-yong-zhan-mo-ni-zhong-xu-bian-li-z/https://leetcode-cn.com/problems/binary-tree-inorder-traversal/solution/acm-xuan-shou-tu-jie-leetcode-er-cha-shu-mbxp/原创 2022-02-27 16:51:57 · 465 阅读 · 0 评论 -
LeetCode —— [1. 两数之和]
题目描述:给定一个整数数组 nums和一个目标值 target,请你在该数组中找出和为目标值的那两个整数,并返回他们的数组下标。你可以假设每种输入只会对应一个答案。但是,你不能重复利用这个数组中同样的元素。示例:给定 nums = [2, 7, 11, 15], target = 9因为 nums[0] + nums[1] = 2 + 7 = 9所以返回 [0, 1]1、将求和转化为求差2、建立哈希表,通过哈希函数(数组中的值和索引分别为key-value)建立对应...原创 2022-02-26 20:49:53 · 283 阅读 · 0 评论