Java one line without regex


  • 0
    U

    public class Solution {
    public boolean checkRecord(String s) {
    return !(s.indexOf('A')!=s.lastIndexOf('A') || s.contains("LLL"));
    }
    }


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.