If previous character is '0' than we put both '1' and '0' at end of string example str = "00" then new string "001" and "000"
if ( str [ n - 1 ] == ' ' ) { str [ n ] = ' ' ; generateAllStringsUtil ( K , str , n + 1 ) ; str [ n ] = ' ' ; generateAllStringsUtil ( K , str , n + 1 ) ; } }