Intermediate Algorithm Scripting - Steamroller

Tell us what’s happening:

Describe your issue in detail here.

Your code so far

###This is my code, and I don’t know whether this method is the right one for problem-solving."

function steamrollArray(arr) {
  let nArr = [];
  let isArr = [];
  nArr.push(arr.filter(ele => !Array.isArray(ele)));
  isArr.push(arr.filter(ele => Array.isArray(ele)));
  isArr = isArr
    .join()
    .split('')
    .filter(ele => !/\W/.test(ele));
  return nArr[0].concat(
    isArr.map(ele => (parseInt(ele) ? parseInt(ele) : ele))
  );
}

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36

Challenge Information:

Intermediate Algorithm Scripting - Steamroller

Are you running into an error or problem?

No it works fine
But as I’m preparing for interviews if i run into similar type of questions is this solution valid

Are methods allowed to use on interviews

I don’t think there is a rule about that, it depends on the interview. I doubt it would be a problem. You would have to ask the interviewer.

Thanks a lot for clarifying