@StefanPochmann Yeah, totally understand, I think it is even harder to write a proper assertion program than actually solve this problem. So I think don't bother, just let it crash ;).
@xtermx In this problem, a null subtree is represented by empty string, not by a pair of () contains nothing. But good points, we should make it more clear in the description. Thanks!