I've tested the method with various cases and can give the expected results, but just can't pass the validator. Any one can help?