399. Evaluate Division

class Solution(object):
    def calcEquation(self, equations, values, queries):
        """
        :type equations: List[List[str]]
        :type values: List[float]
        :type queries: List[List[str]]
        :rtype: List[float]
        """
        #Floyed-Warshall, find all shortest path in a graph
        #dynamic programming 
        #default d[i][j]=inf, if d[i][k]+d[k][j]

你可能感兴趣的:(399. Evaluate Division)