• + 0 comments

    Here's my easiest javascript solution :)

    let result=Array.from({ length: p.length });
        let positionVal;
        
        p.forEach((elem,index)=>{
            positionVal=(p.indexOf(index+1))+1;
            result[elem-1]=positionVal
        })
      
        return result;