All problems
Quadratic Minimizer Existence
Problem
For f(x) = a x^2 + b x + c, a finite minimizer exists only when a > 0, and then x* = -b / (2a).
Given a, b, and c, return the minimizer, or None when a <= 0.
Hint
A concave or linear objective diverges to -infinity.
Test cases
case 1
in: [1,4,0]
expected: -2
case 2
in: [-1,2,0]
expected: null
case 3
in: [2,-8,3]
expected: 2
Starter codePython
def quadratic_minimizer_existence(a, b, c):
# Your code here
pass3 test cases · run your code against them in the editor