[Java][Array][LeetCode] Create Target Array in the Given Order #1389

  • Initially target array is empty.
  • From left to right read nums[i] and index[i], insert at index index[i] the value nums[i] in target array.
  • Repeat the previous step until there are no elements to read in nums and index.
Input: nums = [0,1,2,3,4], index = [0,1,2,2,1]
Output: [0,4,1,3,2]

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

First Rails JSON API

Django For Beginners

Dev Log 6

MapR raises $56M, Mesosphere adds Kubernetes, and John Deere does AI

20 Critically Underrated Python Packages For DS/ML

[LeetCode] 2000. Reverse Prefix of Word (Swift)

READ/DOWNLOAD!# Pro Java Clustering and Scalabilit

Users are not upgrading your app? Here’s what you should do…

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
SP Hou

SP Hou

More from Medium

The Current Residential Property Rental Market In Singapore

Strategy Roundup: Jan 14, 2022

Feature Destination: Cocos Keeling Islands: The Islands

What is a dynamic libraries