每日leetcode_LCP01猜数字

每日leetcode_LCP01猜数字

记录自己的成长,加油。

题目出处:LCP 01. 猜数字 - 力扣(LeetCode)

题目

解题

class Solution {
    
    
    public int game(int[] guess, int[] answer) {
    
    
        int count = 0;
        for (int i = 0 ; i< guess.length; i++){
    
    
            if(guess[i] == answer[i]){
    
    
                count ++;
            }
        }
        return count;
    }
}

猜你喜欢

转载自blog.csdn.net/qq_45925197/article/details/133781166
今日推荐