solved first two phases of lab 2 and most of bits.c
even tree hacker rank exercise