Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
355 B
2
Indexable
Never
let comet2 = "ABSTAR";
let group2 = "XYDATA";

if(getScore(comet2) == getScore(group2)) {
        console.log("GO");
    } else {
        console.log("STAY");
    }

function getScore(word) {
  
    let score = 1;

    for(let i = 0; i < word.length; i++) {
        score *= Number.parseInt(word[i]) - 64;
    }

    return score % 47;
}