Solution without harder case test.