📜  hackerrank 比较三元组 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:33.490000             🧑  作者: Mango

代码示例2
func compareTriplets(a []int32, b []int32) []int32 {
    var arr []int32
    var alice, bob int32

    for i, _ := range a {
        if a[i] > b[i] {
            alice++
        } else if a[i] < b[i] {
            bob++
        }
    }

    data := append(arr, alice, bob)
    return data
}