File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 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.
55
66For expediency, when problems involve an array, I am OK with using a Python list
77instead 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
99- ` 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
1112- ` nums[-1] ` to get the last element
1213
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
1516made to evade the topic(s) or data structure(s) that the question is testing.
1617
1718I very much welcome suggestions and corrections. Thanks.
You can’t perform that action at this time.
0 commit comments