Created
March 13, 2020 16:57
-
-
Save tony9402/155a377ae6c4e8cb3178bea1b94b9b91 to your computer and use it in GitHub Desktop.
Codeforces
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<bits/stdc++.h> | |
#define endl "\n"; | |
using namespace std; | |
typedef long long ll; | |
int main() { | |
ios::sync_with_stdio(false); | |
cin.tie(0); | |
int t; | |
cin >> t; | |
while (t--) { | |
string arr; cin >> arr; | |
arr = "S" + arr + "E"; | |
int maxi = 0, idx = 0; | |
for(int i=1;i<arr.size();i++){ | |
if (arr[i] == 'R' || arr[i] == 'E') { | |
maxi = max(maxi, i - idx); | |
idx = i; | |
} | |
} | |
cout << maxi << endl; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment