• + 0 comments

    I think this solution fails in following case (which seems to fit in problem input constraints)

    d=1 arr=[2, 2, 3, 4, 4]

    i would expect the result to be 4.