Fanatics interview question

1. DS Array Medium Question