File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -5,13 +5,14 @@ complexity and how I arrive at them.
5
5
6
6
For expediency, when problems involve an array, I am OK with using a Python list
7
7
instead and using the following operations:
8
- - ` for i in range(n): ` to iterate over the list
8
+ - ` for i in range(n): ` to iterate over indexes
9
9
- ` for i in range(bigger, smaller, -1): ` to iterate backwards
10
- - ` for i, v in enumerate(nums): ` to iterate over index and value simultaneously
10
+ - ` for num in nums: ` to iterate over values
11
+ - ` for i, num in enumerate(nums): ` to iterate over indexes and values simultaneously
11
12
- ` nums[-1] ` to get the last element
12
13
13
- While these operations are indeed Pythonic, they don't provide any extra
14
- fundamental functionality over a low-level array. No shortcuts are intentionally
14
+ While these operations are indeed Pythonic, they don't fundamentally provide any
15
+ extra functionality over a low-level array. No shortcuts are intentionally
15
16
made to evade the topic(s) or data structure(s) that the question is testing.
16
17
17
18
I very much welcome suggestions and corrections. Thanks.
You can’t perform that action at this time.
0 commit comments