Longest Word in Dictionary through Deleting Solutions in GoNumber 524Difficulty MediumAcceptance 48.5%Link LeetCodeOther languages —SolutionsGo solution by halfrost/LeetCode-Gopackage leetcode func findLongestWord(s string, d []string) string { res := "" for i := 0; i < len(d); i++ { pointS := 0 pointD := 0 for pointS < len(s) && pointD < len(d[i]) { if s[pointS] == d[i][pointD] { pointD++ } pointS++ } if pointD == len(d[i]) && (len(res) < len(d[i]) || (len(res) == len(d[i]) && res > d[i])) { res = d[i] } } return res}package leetcode func findLongestWord(s string, d []string) string { res := "" for i := 0; i < len(d); i++ { pointS := 0 pointD := 0 for pointS < len(s) && pointD < len(d[i]) { if s[pointS] == d[i][pointD] { pointD++ } pointS++ } if pointD == len(d[i]) && (len(res) < len(d[i]) || (len(res) == len(d[i]) && res > d[i])) { res = d[i] } } return res }