give array integer num index your task create target array follow rulesinitially target array emptyFrom leave right read numsi indexi insert index indexi value numsi target arrayrepeat previous step element read num indexReturn target arrayit guarantee insertion operation valid Example 1input num 01234 index 01221output 04132explanationnums index target0 0 01 1 012 2 0123 2 01324 1 04132example 2input num 12340 index 01230output 01234explanationnums index target1 0 12 1 123 2 1234 3 12340 0 01234example 3input num 1 index 0output 1 Constraints1 numslength indexlength 100numslength indexlength0 numsi 1000 indexi