Noom Interview Question

write a data structure for this hypothetical functionality