Leetcode: 1416. Restore The Array Description A program was supposedtoprint anarrayofintegers. The program forgottoprint whitespacesandthearrayisprinted as astringofdigitsandallwe knowisthatallintegersinthearraywereintherange[1, k]andthere are no leading zerosinthearray. Given thestringsandtheintege...
There is an integer arraynumsthat consists ofnunique elements, but you have forgotten it. However, you do remember every pair of adjacent elements innums. You are given a 2D integer arrayadjacentPairsof sizen - 1where eachadjacentPairs[i] = [ui, vi]indicates that the elementsuiandviare a...
package leetcode import ( "strconv" ) func restoreIPAddresses(s string) []string { if s == "" { return []string{} } res, ip := []string{}, []int{} dfs(s, 0, ip, &res) return res } func dfs(s string, index int, ip []int, res *[]string) { if index == len(s)...
1929-concatenation-of-array.rs 1930-unique-length-3-palindromic-subsequences.rs 1963-minimum-number-of-swaps-to-make-the-string-balanced.rs 1984-minimum-difference-between-highest-and-lowest-of-k-scores.rs 2001-number-of-pairs-of-interchangeable-rectangles.rs 2002-maximum-product-of-the-length-of...
https://leetcode.com/problems/restore-ip-addresses/ Given a string containing only digits, restore it by returning all possible valid IP address combinations. For example: Given"25525511135", return["255.255.11.135", "255.255.111.35"]. (Order does not matter) ...