You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
#include <bits/stdc++.h>
|
|
using namespace std;
|
|
char s[1010];
|
|
int main()
|
|
{
|
|
int T, n;
|
|
scanf("%d", &T);
|
|
while (T--)
|
|
{
|
|
scanf("%d%s", &n, s);
|
|
int ans = n - 1;
|
|
for (int i = 0; i < n; ++i)
|
|
if (s[i] == '>' || s[n - 1 - i] == '<')
|
|
ans = min(ans, i);
|
|
printf("%d\n", ans);
|
|
}
|
|
return 0;
|
|
} |