Our good friend Domo is an employee at a company that stores employee information in a CSV (comma-separated values) file. Each row represents one employee, and each column contains different details such as name, age, and city.
However, sometimes your friend only needs certain columns to create a smaller report (for example, only the name and city). Instead of doing this manually, they asked you to write a program that automatically extracts the requested columns from the CSV data.

You are given the CSV content as a string and a list of column indices to keep. Write a program to return a new CSV string that contains only the selected columns.
You may start with the given code
Please Submit the whole code, not only the functions
The first line of the input contains the space-separated list of column indices to extract.
Followed by the CSV content, where:
Rows are separated by newline \n
Columns are separated by commas ,
Constraints
1 ≤ Number of rows ≤ 1000
1 ≤ Number of columns ≤ 50
Column indices are 0-based and valid
0 <= indices < Number of columns
To signal EOF you can use Ctrl + Z + Enter (Windows) or Ctrl + D (Linux/Mac)
Output the CSV string containing only the selected columns, with rows preserved.
Output Format: