Report Cheated Submission!


  • 0
    M

    In the submission, the sample 8 ms submission is as follows:

    class Solution {
        public boolean repeatedSubstringPattern(String s) {
            if (s == null || s.length() <= 1) return false;
            int len = s.length(), mid = len >>> 1;//一半
            if (s.substring(0, mid).equals(s.substring(mid))) return true;
            int one_third = len/3;//三分之一
            String sub = s.substring(0, one_third);
            if (sub.equals(s.substring(one_third, one_third * 2))
                    && sub.equals(s.substring(one_third * 2))) return true;       
            if (len % 2 == 1) {//奇数个字符
                char c = s.charAt(0);
                for (int i = 1; i < len; i ++) {
                    if (s.charAt(i) != c) return false;
                }
                return true;
            }
            return false;
    	}
        
    }
    

    while it fails with test case "abcabcabcabcabc". Where should I report these cheated submissions? Thanks for letting me know.


  • 0
    K

    Those cheating solutions are there for a long time! Why LeetCode still don't update the test cases?


Log in to reply
 

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