Write a Kotlin function to parse CSV data provided as a string, and return the data in a structured format.
The CSV data will be provided as a single string, where each line represents a row and each value is separated by a comma. The function should parse this string and convert it into a List<Person>
test cases
- A simple CSV string.
- A CSV string with empty lines.
- A CSV string with different line endings.
- A CSV string with a missing element in one of the rows.
- Fill in the code.
- You can copy the code into IntelliJ/Android Studio, but it shouldn’t be necessary.
- Click “run” – the green triangle. The code will compile and several tests will be run.
- In the logs, you will see “try again” if the solution is incorrect, or “success” and a special code.
- Provide this code in the form below along with your email and click “send”.
- Solutions will be presented the next day on Instagram