functiontandemBicycle(redShirtSpeeds, blueShirtSpeeds, fastest) {redShirtSpeeds.sort((a, b) => a - b);blueShirtSpeeds.sort((a, b) => a - b);if (fastest ===true) {blueShirtSpeeds.sort((a, b) => b - a); }let totalSpeed =0;for (let i =0; i <redShirtSpeeds.length; i++) {constmax=Math.max(redShirtSpeeds[i], blueShirtSpeeds[i]); totalSpeed += max; }return totalSpeed;}// Do not edit the line below.exports.tandemBicycle = tandemBicycle;