📌  相关文章
📜  第14天python代码示例中的范围hackerrank解决方案

📅  最后修改于: 2022-03-11 14:45:49.354000             🧑  作者: Mango

代码示例1
// day 14 scope hackerrank solution in python
 # Add your code here
    def computeDifference(self):
        maxDiff = 0
        arr = self.__elements
        for i in range(len(arr)):
            for j in range(i+1, len(arr)):
                if abs(arr[j] - arr[i]) > maxDiff:
                    maxDiff = abs(arr[j] - arr[i])
        self.maximumDifference = maxDiff