Mars Exploration

  • + 0 comments

    My Javascript solution here:

    function marsExploration(s: string): number {
        const expected = "SOS".repeat(s.length / 3).split("");
        return expected.reduce((acc, curr, i) => acc + +(curr !== s[i]), 0);
    }