you give integer array target integer nYou stack follow operationspush push integer stackpop remove integ stackyou stream integer range 1 nUse stack operation number stack equal target you follow follow rulesIf stream integer pick integer stream push stackIf stack pop integer stackif moment element stack equal target read new integer stream operation stackreturn stack operation need build target follow mention rule if multiple valid answer return Example 1input target 13 n 3output pushpushpoppushexplanation initially stack s the element stackread 1 stream push stack s 1read 2 stream push stack s 12pop integer stack s 1read 3 stream push stack s 13example 2input target 123 n 3output pushpushpushexplanation initially stack s the element stackread 1 stream push stack s 1read 2 stream push stack s 12read 3 stream push stack s 123example 3input target 12 n 4output pushpushexplanation initially stack s the element stackread 1 stream push stack s 1read 2 stream push stack s 12since stack equal target stop stack operationsthe answer read integer 3 stream accept Constraints1 targetlength 1001 n 1001 targeti ntarget strictly increase