fork download
  1. public class Solution {
  2.  
  3. public static boolean checkAB(String input) {
  4.  
  5. if (input.length() == 0)
  6. return true;
  7.  
  8. if (input.charAt(0) == 'a') {
  9.  
  10. if (input.length() >= 3 && input.substring(0, 3).equals("abb"))
  11. return checkAB(input.substring(3));
  12.  
  13. else
  14. return checkAB(input.substring(1));
  15. }
  16.  
  17.  
  18. return false;
  19. }
  20. }
  21.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:1: error: class Solution is public, should be declared in a file named Solution.java
public class Solution {
       ^
1 error
stdout
Standard output is empty