Didn't see anyone else try it in C, so here's my solution in C:
#include "stdio.h"
#include "stdlib.h"
unsignedintbus(unsignedint(*data)[2],size_tn){unsignedintsum=0;for(size_ti=0;i<n;++i){sum+=(data[i][0]-data[i][1]);}returnsum;}intmain(intargc,charconst*argv[]){// Read in data, somehowprintf("Passengers remaining after last stop: %u\n",bus((unsignedint[][2]){{1,0},{2,1},{5,3},{4,2}},4));// 6return0;}
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Didn't see anyone else try it in C, so here's my solution in C: