Spire Global interview question

C Programming , Data structures, Problem solving