Simple Java Solution
Code\n\nclass Solution {\n\n    public String findLexSmallestString(String s, int a, int b) {\n        HashSet<String> hset=new HashSet<String>();\n        Queu
# Code\n```\nclass Solution {\n\n    public String findLexSmallestString(String s, int a, int b) {\n        HashSet<String> hset=new HashSet<String>();\n        Queue<String> q=new LinkedList<String>();\n        hset.add(s);\n        q.add(s);\n        String res=s;\n        while(q.size()>0)\n        {\n           String str=q.poll();\n           char c[]=str.toCharArray();\n           char ch[]=new char[c.length];\n           for(int i=0;i<c.length;i++)\n           {\n               ch[(i+b)%str.length()]=c[i];\n           }\n           String p=new String(ch);\n           if(!hset.contains(p))\n           {\n                if(res.compareTo(p)>0)\n                {\n                    res=p;\n                }\n                hset.add(p);\n                q.add(p);\n           }\n           for(int i=1;i<str.length();i=i+2)\n           {\n               int l=c[i]-\'0\';\n               l=(l+a)%10;\n               c[i]=(char)(48+l);\n           }\n          p=new String(c);\n           if(!hset.contains(p))\n           {\n                if(res.compareTo(p)>0)\n                {\n                    res=p;\n                }\n                hset.add(p);\n                q.add(p);\n           }\n\n        }\n\n        return res;\n    }\n}\n```
['Java']