Problema de exploração de Marte em JS

Please refer this link for problem statement click here
 


    function marsExploration(message) {
        let sos = "SOS";
        let count = 0;
        for (let i = 0; i < message.length; i++) {
            if (message.charAt(i) != sos.charAt(i % 3)) count++;
        }
        return count;
    }
Distinct Dugong