Doubt in SanketAndStrings

can i get the c++ code solution for this problem.