leetcode08-棒球比赛

题目链接:

https://leetcode.cn/problems/baseball-game/description/?envType=study-plan-v2&envId=programming-skills

思路:

模拟题,思路见代码即可。 

代码:

class Solution {
    public int calPoints(String[] operations) {
        int[] sum = new int[1010];
        int n = operations.length;
        int idx= 0,res = 0;
        //进行模拟
        for(int i = 0;i

 

你可能感兴趣的:(leetcode刷题日记,java,leetcode)