Reduce Object Array Typescript Interview