mirror of
https://github.com/devenperez/leetcode.git
synced 2026-06-13 14:57:08 +00:00
11 lines
267 B
Python
11 lines
267 B
Python
class Solution(object):
|
|
def buildArray(self, nums):
|
|
"""
|
|
:type nums: List[int]
|
|
:rtype: List[int]
|
|
"""
|
|
ans = [0] * len(nums)
|
|
for i in range(len(nums)):
|
|
ans[i] = nums[nums[i]]
|
|
|
|
return ans |