I thought this was going to be relatively simple, then spent the next few hours changing my data structure 3 times, forgetting return statement, mucking up syntax etc. etc Got there eventually but definitely need to keep practicing until this becomes more natural. https://codesandbox.io/p/sandbox/rj3ry2 tips and feedback welcome :)