Everything seems fine but still cant pass a single testcase

its done, i forgot to subtract res from n.