Ambiguous Coordinates || JAVASCRIPT || Solution by Bharadwaj
Approach\nBrute Force\n\n# Complexity\n- Time complexity:\nO(n^4)\n\n- Space complexity:\nO(n^2)\n\n# Code\n\nvar ambiguousCoordinates = function(s) {\n   let a
# Approach\nBrute Force\n\n# Complexity\n- Time complexity:\nO(n^4)\n\n- Space complexity:\nO(n^2)\n\n# Code\n```\nvar ambiguousCoordinates = function(s) {\n   let ans = [];\n   for(let i = 2; i < s.length - 1; i++){\n       let left = s.slice(1, i);\n       let right = s.slice(i, s.length - 1);\n\n       let ls = [left], rs = [right];\n       for(let i = 1; i < left.length; i++){\n         let temp1 = left.slice(0, i);\n         let temp2 = left.slice(i);\n           ls.push(`${temp1}.${temp2}`);\n       }\n       for(let i = 1; i < right.length; i++){\n        let temp1 = right.slice(0, i);\n        let temp2 = right.slice(i, right.length);\n           rs.push(`${temp1}.${temp2}`);\n       }\n       for(let l of ls){\n       if(!/^([1-9]\\d*|0\\.\\d*[1-9]|[1-9]\\d*\\.\\d*[1-9]|0)$/i.test(l)) continue;\n       for(let r of rs){\n        if(!/^([1-9]\\d*|0\\.\\d*[1-9]|[1-9]\\d*\\.\\d*[1-9]|0)$/i.test(r)) continue;\n        ans.push(`(${l}, ${r})`);\n       }\n     }\n   }\n   return ans;\n};\n```
['JavaScript']