Back to problems

Evaluate Division

Algorithm · Uber · Medium

Evaluate Division Coding · Phone · Software Engineer · Reported September 2025 You receive equations of the form A / B = k. Each equation is encoded as equations[i] = [A, B], with its corresponding result stored in values[i] = k. For every query [C, D], produce the calculable value of C / D; when the available equations do not determine that ratio, return -1.0. Examples Example 1: Input: equations = [["a","b"],["b","c"]], values = [2.0,4.0], queries =…

Checking your access…