Best Java Solution || Beats 100%
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    static double distance(int arr1[], int arr2[]){\n        int x1 = arr1[0];\n        int y1 = arr1[1];\n\n        int x2 = arr2[0];\n        int y2 = arr2[1];\n\n        return Math.sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));\n    }\n\n    public boolean escapeGhosts(int[][] ghosts, int[] tar) {\n\n        double d1 = Math.abs(tar[0])+Math.abs(tar[1]);\n\n        double d2 = Double.MAX_VALUE;\n\n        for(int i=0; i<ghosts.length; i++){\n            int a = Math.abs(ghosts[i][0]-tar[0])+Math.abs(ghosts[i][1]-tar[1]);\n            d2 = Math.min(a,d2);\n        }\n\n        if(d1<d2) return true;\n        return false;\n    }\n}\n```
['Java']