make solutions more compact
- variable are implicitly initialized to 0 or ""
- NR == 1 represents the header line
Awesome solutions. The changes look great! However, since this repository is geared towards learners, I appreciate the more verbose nature of the current version in master to provide additional context and clarity.
For some of the advanced solutions I would need more explanation :D
I also appreciate your solution for 16b (median, "extra credit"), which -- despite incomplete definition, has the correct solution in this case. You get the number of values plus the header which works for an uneven number of values, however, for an even number of values n you would have take the average of the middle numbers: (value[n/2] + value[(n/2)+1] )/2 It's up for discussion if it's enough to have the solution for the data at hand or if a general solution is needed. IMO it's better to have an incomplete solution than none at all ;)
Thanks for the reply.
However, since this repository is geared towards learners, I appreciate the more verbose nature of the current version in master to provide additional context and clarity.
Totally agree.
For the story, I was looking for advanced AWK material when I come to this repo. AWK saved my life as an engineer so many times ...
For some of the advanced solutions I would need more explanation
Sure, with pleasure ! Which ones ?
however, for an even number of values n you would have take the average of the middle numbers
Ah, nerd trap ! Now I have to fix this :)