C++ Solution || Slow but Easy To Understand || Find LCM of both the strings || Shorter code
```\nlong a=0,b=0;\n    void lcm(string s1, long n1, string s2, long n2)\n    {\n        int i=0,j=0;\n        bool pos=false;\n        while(1)\n        {\n   
```\nlong a=0,b=0;\n    void lcm(string s1, long n1, string s2, long n2)\n    {\n        int i=0,j=0;\n        bool pos=false;\n        while(1)\n        {\n            while(i<s1.length() && j<s2.length() && a<n1)\n            {\n                if(i==0 && j==0 && pos)\n                    return;\n                pos=true;\n                if(s1[i]==s2[j])\n                    j++;\n                if(j==s2.length())\n                {\n                    b++;\n                    j=0;\n                }\n                i++;\n                if(i==s1.length())\n                {\n                    a++;\n                    i=0;\n                }\n            }\n            if(a==n1)\n                return;\n        }\n    }\n    int getMaxRepetitions(string s1, long n1, string s2, long n2) {\n        if(n1==0 || n2==0)\n            return 0;\n        lcm(s1,n1,s2,n2);\n        return (long)(n1*b)/(long)(a*n2);\n    }
[]