Leetcode 2048 Solution
This article provides solution to leetcode question 2048 (build-array-from-permutation)
Access this page by simply typing in "lcs 2048" in your browser address bar if you have bunnylol configured.
Leetcode Question Link
https://leetcode.com/problems/build-array-from-permutation
Solution
class Solution:
def buildArray(self, nums: List[int]) -> List[int]:
ans = []
for num in nums:
ans.append(nums[num])
return ans