Skip to content

Latest commit

 

History

History
13 lines (11 loc) · 311 Bytes

LCP 01. 猜数字.md

File metadata and controls

13 lines (11 loc) · 311 Bytes
/**
 * @param {number[]} guess
 * @param {number[]} answer
 * @return {number}
 */
var game = function (guess, answer) {
    return guess.reduce((count, value, index) => +(guess[index] === answer[index]) + count, 0);
};