Codes of the string doubt

how to not print the last comma in the output as the answer demands no comma after last output

hello @rohit_1906
store ur all output strings in vector/array and then u can avoid it easily.