System.out.println(a1.matches("(.*)i"));//check given string ends with i for string manish kumar tiwari System.out.println(a1.matches("(.*)k"));//check if letter k is ...
Given two strings A and B, find the minimum number of times A has to be repeated such that B is a substring of it. If no such solution, return -1. For example, with A = "abcd" and B = "cdabcdab".