#include "laugh.h"
#include<bits/stdc++.h>
using namespace std;
int longest_laugh(std::string s)
{
int ans = 0, cur = 0;
int n = s.size();
for (int i = 0; i < n; i++) {
if (s[i] == 'a' || s[i] == 'h')
cur++;
else
ans = max(ans, cur), cur = 0;
}
ans = max(ans, cur);
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
numbers differ - expected: '2', found: '14' |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
numbers differ - expected: '2', found: '14' |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
numbers differ - expected: '2', found: '14' |
3 |
Halted |
0 ms |
0 KB |
- |