• + 0 comments

    There's a constraint: 0 <= k <= 10^9

    In your case of negative k, the minimum value can be obtained by the similar approach. Imagine a valley rather than a mountain.