Golang 0ms Solution
go\nfunc findLexSmallestString(s string, a int, b int) string {\n\tif a == 3 || a == 7 || a == 9 {\n\t\ta = 1\n\t}\n\tif a == 4 || a == 6 || a == 8 {\n\t\ta = 2
```go\nfunc findLexSmallestString(s string, a int, b int) string {\n\tif a == 3 || a == 7 || a == 9 {\n\t\ta = 1\n\t}\n\tif a == 4 || a == 6 || a == 8 {\n\t\ta = 2\n\t}\n\t// a in [1,2,5] now\n\n\tsmallest := s\n\tprocessed := make([]bool, len(s))\n\tfor i := 0; processed[i%len(s)] == false; i += b {\n\t\tindex := i % len(s)\n\t\tprocessed[index] = true\n\t\tif cur := minimizing(s[len(s)-index:]+s[:len(s)-index], a, b%2 == 1); cur < smallest {\n\t\t\tsmallest = cur\n\t\t}\n\t}\n\treturn smallest\n}\n\nfunc minimizing(original string, step int, changePrev bool) string {\n\tinRune := []rune(original)\n\tminus := rune(0)\n\tminusPrev := rune(0)\n\tswitch step {\n\tcase 1:\n\t\tminus = inRune[1] - \'0\'\n\t\tminusPrev = inRune[0] - \'0\'\n\tcase 2:\n\t\tminus = inRune[1] - \'0\'\n\t\tminusPrev = inRune[0] - \'0\'\n\t\tif minus%2 == 1 {\n\t\t\tminus--\n\t\t}\n\t\tif minusPrev%2 == 1 {\n\t\t\tminusPrev--\n\t\t}\n\tcase 5:\n\t\tif inRune[1] >= \'5\' {\n\t\t\tminus = 5\n\t\t}\n\t\tif inRune[0] >= \'5\' {\n\t\t\tminusPrev = 5\n\t\t}\n\t}\n\tfor i := 1; i < len(inRune); i += 2 {\n\t\tinRune[i] -= minus\n\t\tif inRune[i] < \'0\' {\n\t\t\tinRune[i] += 10\n\t\t}\n\t\tif changePrev {\n\t\t\tinRune[i-1] -= minusPrev\n\t\t\tif inRune[i-1] < \'0\' {\n\t\t\t\tinRune[i-1] += 10\n\t\t\t}\n\t\t}\n\t}\n\treturn string(inRune)\n}\n```
['Go']