Untitled

mail@pastecode.io avatar
unknown
c_cpp
2 years ago
381 B
0
Indexable
Never
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int t;
    cin >> t;
    for(int i = ***; i <= t; i++)
    {
        string s;
        cin >> s;
        s='@'+***;
        int cntU=0,cntD=0;
        for(int j=1;j<***.size();j++){
            if(s[j]=='U' && ***)cntU++;
            if(*** && s[j-1]!='D')cntD++;
        }

        cout<<min(***,***)<<endl;
    }
}