Generate a String of having N * N distinct non | C ++ Program to implement the above approach ; Function to construct a string having N * N non - palindromic substrings ; Driver Code
#include <bits/stdc++.h> NEW_LINE using namespace std ; void createString ( int N ) { for ( int i = 0 ; i < N ; i ++ ) { cout << ' a ' ; } for ( int i = 0 ; i < N ; i ++ ) { cout << ' b ' ; } } int main ( ) { int N = 4 ; createString ( N ) ; return 0 ; }