[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

Git — an advanced introduction

23 Python Pandas Snippets That Will SaveYou Time

AWS : Solutions Architect Associate Exam — Part 4

Using the Azure REST API with PowerShell — Quickstart and Example

Is HP Victus Ryzen 5 5600H a budget killer ?

How a headless browser works with Selenium

How to setup a Kubernetes cluster for a Akash provider(main-net)

RASPBERRY PI FOR BEGINNERS — 2022 COMPLETE COURSE

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

Revolutionary Change in the 2022 Cannabis Industry: Cannabis Expert Liz Rogan Shares Top Three…

Doug Ford Bitcoin Loophole — Review

World Chain Investment Research | Is it expected to catch up with Ethereum in the future?

Do Altcoins Provide a Greener Alternative to the Energy-Intensive Crypto Bitcoin?