add test case for the case the is illegal given the problem statement, but this solution allows for.