⌨️

[AtCoder]ABC-184|B - Quizzes

2023/03/28に公開

設問ページ

提出結果

def getIntMap():
    return map(int, input().split())


def getString():
    return input()


def main():
    n, x = getIntMap()
    s = list(getString())

    for a in s:
        x += 1 if a == 'o' else -1
        x = max(x, 0)
    print(x)


if __name__ == "__main__":
    main()

Discussion