Mod: Solution using array of struct.