Skip to content

Commit 89545f5

Browse files
committed
Fixed typo
1 parent 15a98b3 commit 89545f5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

leetcode/1470_shuffle_the_array.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ def shuffle(self, nums: List[int], n: int) -> List[int]:
77
shuffled_arr = list()
88
i = 0
99
while i < n:
10-
shuffled_arr.extend((nums[i], nums[i+1]))
10+
shuffled_arr.extend((nums[i], nums[i+n]))
1111
i += 1
1212

1313
return shuffled_arr
1414

1515
# Note:
16-
# 1. Extend better than multiple appens
16+
# 1. Extend better than multiple appends
1717
# 2. List creation more expensive than tuple

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy