problem statement wasn't clear about whether it wanted the max to be inclusive or not, fixing