Evaluate piecewise linear function at x | Two Sigma Coding Question