SOURCE

var niu_Boll = function (ss,value) {
    const res = [];
    var bk = value;
    let seat = [];
    let noseat = [];
    for (let i = 0; i < 3; i++) {
        for (let j = i + 1; j < bk.length; j++) {
            for (let k = j + 1; k < bk.length; k++) {
                if ((bk[i] + bk[j] + bk[k]) % 10 == 0) {
                    seat = [i, j, k]
                    break;
                }
            }
            // if ((bk[i] + bk[j] + bk[j + 1]) % 10 == 0) {
            //     seat = [i, j, j + 1]
            //     break;
            // }
        }
    }
    if (seat.length == 3) {
        bk.forEach((v, i) => {
            if (seat.indexOf(i) == -1) {
                noseat.push(i);
            }
        })
        let num = (bk[noseat[0]] + bk[noseat[1]]) % 10
        // res.push(num+10*(ss+1))
        res.push(num)
        // 80:牛牛
    } else {
        res.push(-1) //无牛
    }
    return res;
}

console.log(niu_Boll(0,[1,2,6,8,3]))
console 命令行工具 X clear

                    
>
console