Question
The first row contains the names of the columns. The following rows contain values. For example, the table below is presented by the following string:
The first row contains the names of the columns. The following rows contain values.\ For example, the table below is presented by the following string:
S=
"id,name,age,act.,room,dep.
ln1,Jack,68,T,13,8Vn17,Betty,28,F,15,7
".\ Write a function:\
int solution(char ***S, char ^((
)
***)C );
\ which, given two strings S and C consisting of N and M characters, respectively, returns the maximum value in column C of the table described by S.\ Examples:\ Given S = "id,name,age,act.room,dep.
ln1
, Jack,
68,T,13,(8)/()\ 17,Betty,28,F,15,7
" and
C=
"age", your function should retum 68 since 68 is the maximum of 68 and 28.\ Given S = "area,land\ 3722,CMn6612,RU\ 3855,CA\ 3797,USA" and C = "area",\ your function should return 6612.\ Given
S=
city,temp2,temp\ Paris,7,-3\ Dubai,
4,-(4)/()\
Porto,
-1,-2
" and
C=
"temp",\ your function should return -2 .\ Assume that:\
S
is a string of length
N
in CSV format;\
N
is an integer within the range [3..100,000];\
M
is an integer within the range [1..5];\ there are at least two rows;\ each row has the same, positive number of cells;\ each cell is of length [1..5] and consists only of letters, digits and/or special characters: " - - ;\ C is the name of a unique column in the table, whose values are integers within the range [-9999..9999]; there are no erroneous values in this column;\ there is no new line at the end of string
S
.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started