BFS Solution
Code\n\nfunc findLexSmallestString(s string, a int, b int) string {\n    queue := []string{s}\n    result := s\n\n    isVisited := map[string]bool{}\n    for le
# Code\n```\nfunc findLexSmallestString(s string, a int, b int) string {\n    queue := []string{s}\n    result := s\n\n    isVisited := map[string]bool{}\n    for len(queue) != 0 {\n        currentElement := queue[0]\n        queue = queue[1:]\n        addR := add(currentElement, a)\n        if _,exists := isVisited[addR]; !exists{\n            queue = append(queue,addR)\n            isVisited[addR] = true\n        }\n        replaceR := replace(currentElement, b)\n        if  _,exists := isVisited[replaceR]; !exists{\n            queue = append(queue, replaceR)\n            isVisited[replaceR] = true\n        }\n        result = compare(currentElement, result)\n    }\n    return result\n}\n\nfunc add(s string, a int) string {\n    for i:=0;i<len(s);i++{\n        if (i+1) % 2 == 0{\n            num, _ := strconv.Atoi(string(s[i]))\n            s = s[:i] + fmt.Sprintf("%d",(num+a) % 10) + s[i+1:]\n        }\n    }\n    return s\n}\n\nfunc replace(s string, b int) string {\n    replaceNum := b % len(s)\n        last := string(s[len(s)-replaceNum:])\n        s = s[:len(s)-replaceNum]\n        s = last + s\n    return s\n}\n\nfunc compare(s string, result string) string {\n    for i:=0;i<len(s);i++{\n        if s[i] == result[i] {\n            continue\n        }\n        if s[i] > result[i] {\n            return result\n        }\n        return s\n    }\n    return s\n}\n```
['Go']