We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
This solution is going crazy for me: I have tried like this
I have this code:
functionprocessData(input){//Enter your code here//left<p, right>pletar;letp=input[0]letleft=[]letright=[]if(input.length<=1)returninputelse{for(leti=1;i<input.length;i++){if(input[i]>p){right.push(input[i])}else{left.push(input[i])}}ar=[...processData(left.slice(0).filter((d)=>d<p)),p,...processData(right.slice(0).filter((d)=>d>p))]}console.log(...ar)returnar}process.stdin.resume();process.stdin.setEncoding("ascii");_input="";process.stdin.on("data",function(input){_input+=input;});process.stdin.on("end",function(){processData(_input.replace(/\s+$/g,'').split('').map((num)=>parseInt(num),10));});
And output is like this:
231231235//How to get rid of this part89// and this part1235789
if anybody knows please suggests me!!
`
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Quicksort 2 - Sorting
You are viewing a single comment's thread. Return to all comments →
This solution is going crazy for me: I have tried like this
I have this code:
And output is like this:
if anybody knows please suggests me!!
`