Company: Intuit_7aug
Difficulty: medium
One-hot Encoding Problem Description A data set consists of a table with one column containing string values. Your goal is to perform a so-called 'one-hot encoding' of this column, where the categorical string values are decoded into the following numerical form: for every unique value in the original column, the newly created column has values of 1 and 0 otherwise (see examples below). Input: The first line of input contains an integer N, representing the number of rows. The second line of input contains an integer M, representing the number of columns. The next N lines of input contain M comma-separated strings. Examples Example 1: Input: 4 2 0,Bolivia 1,Bolivia 2,Bolivia 3,Germany Output: 0,1,0 1,1,0 2,1,0 3,0,1 Explanation: We have two unique values - Bolivia and Germany so there will be two new columns: 'is_it_Bolivia' and 'is_it_Germany'. They are sorted in this order because B is before G. The first three rows have Bolivia value, so there is 1 in the first column and 0 in the se