scala solution
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nobject Solution {\n    def findLexSmallestString(s: String, a: Int, b: Int): String = {\n    val n = s.size\n    val b1 = b % n\n\n    def bfs(queue: List[String], seen: Set[String], smallest: String): String = queue match {\n        case Nil => smallest\n        case s :: rest if seen.contains(s) => bfs(rest, seen, smallest)\n        case s :: rest =>\n        val newSmallest = if (s < smallest) s else smallest\n        val ca = s.toCharArray\n        for (i <- 1 until n by 2) {\n            ca(i) = ((ca(i) - \'0\' + a) % 10 + \'0\').toChar\n        }\n        val newQueue = s.substring(b1) + s.substring(0, b1) :: ca.mkString :: rest\n        bfs(newQueue, seen + s, newSmallest)\n    }\n\n    bfs(List(s), Set.empty, s)\n    }\n\n}\n```
['Scala']