Rainy Season

Problem Link

Solution by augusto100 pts

Code / Notes

#include <bits/stdc++.h>
using namespace std;

int main() {
    string S;
    cin >> S;

    int atual = 0, maior = 0;

    for (int i = 0; i < 3; i++) {
        if (S[i]=='R') {
            atual++;
            if (atual > maior) {
                maior = atual;
            } 
        } else {
            atual = 0;
        }
    }

    cout << maior << endl;
}

Last updated 3 weeks, 3 days ago


« Back to problem