Wrong Test Case?

Правка en1, от a1000, 2020-11-05 20:08:00

Hello there, regarding the problem 58A Chat room (link: https://codeforces.com/problemset/problem/58/A) Test case 5 is "helhcludoo" which is giving me WA and it's wrong according to the problem statement.

My code:-

String s = sc.next(); String regex = ".*(h+)(e+)(l+)(l+)(o+).*"; System.out.println(s.matches(regex)?"YES":"NO");

Am I doing something wrong?

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский a1000 2020-11-05 20:08:00 384 Initial revision (published)