Evaluate Division
You are given an array of variable pairs equations and an array of real numbers values, where equations[i] = [Ai, Bi] and values[i] represent the equation Ai / Bi = values[i]. Each Ai or Bi is a string that represents a single variable. You are also given some queries, where queries[j] = [Cj, Dj] represents the jth query where you must find the answer for Cj / Dj = ?. Return the answers to all queries.
Evaluate Division

You are given an array of variable pairs equations and an array of real numbers values, where equations[i] = [Ai, Bi] and values[i] represent the equation Ai / Bi = values[i]. Each Ai or Bi is a string that represents a single variable. You are also given some queries, where queries[j] = [Cj, Dj] represents the jth query where you must find the answer for Cj / Dj = ?. Return the answers to all queries.

Example 1:
Input: {"equations":[["a","b"],["b","c"]],"values":[2,3],"queries":[["a","c"],["b","a"],["a","e"],["a","a"],["x","x"]]}
Output: [6.0,0.5,-1.0,1.0,-1.0]
Input
arr ={"equations":[["a","b"],["b","c"]],"values":[2,3],"queries":[["a","c"],["b","a"],["a","e"],["a","a"],["x","x"]]}

Built graph with 3 variables

2.00.53.00.3

a

b

c

Query nodes

Path

Visited

Variables
No variables to display
DepthFunction Call
Stack empty
0/6