Driver Code
public static void main ( String [ ] args ) { String S = " aba " ; int N = 2 ; System . out . println ( prefix ( S , N ) ) ; S = " baa " ; N = 3 ; System . out . println ( prefix ( S , N ) ) ; } }