Kotlin best Soltuion | like
\n# Code\n\nclass Solution {\n    private fun leadingZeros(v: String): Int {\n        var leadingZeros = 0\n        while(leadingZeros < v.length && v[leadingZe
\n# Code\n```\nclass Solution {\n    private fun leadingZeros(v: String): Int {\n        var leadingZeros = 0\n        while(leadingZeros < v.length && v[leadingZeros] == \'0\') leadingZeros++\n        return leadingZeros\n    }\n    private fun tailingZeros(v: String): Int {\n        var tailingZeros = 0\n        while(tailingZeros < v.length && v[v.lastIndex - tailingZeros] == \'0\') tailingZeros++\n        return tailingZeros\n    }\n    private fun allValuesOf(n: String): List<String> {\n        val values = mutableListOf<String>()\n        for(decimalPointIndex in 1 .. n.length) {\n            val first = n.substring(0, decimalPointIndex)\n            val fl0 = leadingZeros(first)\n            if(fl0 >= 2 || fl0 != 0 && first.length != 1) continue\n            values += if(decimalPointIndex != n.length) {\n                val second = n.substring(decimalPointIndex)\n                if(tailingZeros(second) != 0) continue\n                "$first.$second"\n            } else first\n        }\n        return values\n    }\n    fun ambiguousCoordinates(s: String): List<String> {\n        val result = mutableListOf<String>()\n        for(breakpoint in 2 .. s.lastIndex - 1) {\n            val firstValues = allValuesOf(s.substring(1, breakpoint))\n            val secondValues = allValuesOf(s.substring(breakpoint, s.lastIndex))\n\n            for(first in firstValues)\n                for(second in secondValues)\n                    result += "($first, $second)"\n        }\n        return result\n    }\n}\n```
['Kotlin']