Company: Zomato
Difficulty: medium
Smallest String Problem Description You are given a string S which consists of digits from 0 to 9 and two integer R and A. There are two operations which you can do on a string. Rotate Add You can use Rotate operation to rotate a string clockwise by R positions. For example if R=1, string "581" will become "158". Also you can use Add operation to add number A to all odd indexes of string (0 based indexing). For example if A=3, then string "781" will become "711". Digits post 9 are cycled back to zero. You can use any of the two operation any number of times in any order to return the lexicographical smallest string. Examples Example 1: Input: S = "712", R = 1, A = 4 Output: "11" Constraints 0 < R <= 10 0 < A <= 100 1 <= len(S) <= 6