【文件属性】:
文件名称:产品经理刷leetcode-leetcodeRecord:myleetcodeRecordleetcode刷题记录
文件大小:53KB
文件格式:ZIP
更新时间:2021-06-30 04:27:46
系统开源
产品经理刷leetcode
leetcodeRecord
my
leetcodeRecord
leetcode刷题记录
1.two
number
--
easy
问题描述
Given
an
array
of
integers,
return
indices
of
the
two
numbers
such
that
they
add
up
to
a
specific
target.
You
may
assume
that
each
input
would
have
exactly
one
solution,
and
you
may
not
use
the
same
element
twice.
Example:
Given
nums
=
[2,
7,
11,
15],
target
=
9,
Because
nums[0]
+
nums[1]
=
2
+
7
=
9,
return
[0,
1].
输入
数组
目标和
输出
数组元素的索引
思路
brute-force
暴力枚举
时间复杂度
O(n**2)
空间复杂度
O(1)
hash-table
第一个存放
值以及索引
hashMap
【文件预览】:
leetcodeRecord-master
----38-Count And Say.py(655B)
----48-Rotate Image.py(801B)
----344-Reverse String.py(410B)
----hupai-majiang.py(2KB)
----237-Delete Node in a Linked List.py(392B)
----28-strstr.py(392B)
----isHW-re.py(908B)
----15-ThreeSum.py(3KB)
----2.Add Two Numbers.py(6KB)
----189-Rotate Array.py(7KB)
----349- Intersection of Two Arrays.py(1KB)
----1.two num.py(727B)
----14-Longest Common Prefix.py(611B)
----121-Best Time to buy and Sell Stock-1.py(1KB)
----26.remove-duplicates-from-sorted-array.py(7KB)
----LICENSE(1KB)
----136-Single Number.py(481B)
----217-Contains Duplicate.py(280B)
----4. Median of Two Sorted Arrays.py(2KB)
----66-Plus One.py(969B)
----atoi.py(908B)
----byteDance.py(55B)
----README.md(104KB)
----122-Best Time to buy and Sell Stock - 1.py(1KB)
----36- valid saduku.py(2KB)
----128- Move zeroes.py(494B)