rsschool-cv

Sergey Levsha

Contacts

You are given two sorted arrays that contain only integers. These arrays may be sorted in either ascending or descending order. Your task is to merge them into a single array, ensuring that:

 mergeArrays(arr1, arr2) {
  let arrSorted = arr1.concat(arr2).sort((a,b)=>a-b);
  for (let i = 0; i < arrSorted.length; i++){
    let rep = arrSorted[i];
    console.log(i);
    if (rep == arrSorted[i + 1]) { arrSorted.splice(i, 1)}
      console.log(arrSorted);

//     return arrSorted
  }
  console.log(arrSorted);
  return arrSorted
} 

Education

Bachelor’s degree, DSTU — Computer Science.

English

I think it’s around intermediate. But in reality it’s pre-intermediate.