Implement the function find_roots to find the roots of the quadratic equation: ax2 + bx + c = 0. The function should return an array containing both roots in any order.


For example, find_roots(2, 10, 8) should return [-1, -4] or [-4, -1] as the roots of the equation 2x2 + 10x + 8 = 0 are -1 and -4.

Ruby 2.5.1 

  •   Example case: Wrong answer
  •   Equal roots: Wrong answer
  •   Distinct roots: Wrong answer

Ruby Arithmetic Public New


Score Distribution
Not enough data for chart
Would you like to see our other questions?


Visit our question library

Private Concierge


On the TestDome Blog

Screening Applicants: The Good, the Bad and the Ugly

