Point72 interview question

Standard coding question like leedcode medium level