Clarification: There seems to be an issue with the last test case for this problem. If your code passes everything but the last test case, consider it to be an AC.