Sum at k level ques in trees

My code is working fine on online compliers and as well as on eclipse but i am getting run error on your CB IDE. Please resolve the issue asap. Link to my code :

@Puneet_Sharma,

https://ide.codingblocks.com/s/209119 here is your correct code.

Don’t create 2 different objects of a scanner class. Instead just pass the scanner object from main method to your constructor.
Because in that case, one of the inputs is taken as \n by the compiler. To avoid that don’t create 2 different objects of the scanner class.