mirror of
https://github.com/devenperez/leetcode.git
synced 2026-06-15 09:57:09 +00:00
Time: 87 ms (96.31%), Space: 13.8 MB (32.79%) - LeetHub
This commit is contained in:
@@ -0,0 +1,11 @@
|
|||||||
|
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
|
||||||
Reference in New Issue
Block a user