Without using algebra:
Since there were twice as many boys as girls, think of dividing the
boys into two equal groups, and letting all the girls be a third group.
Then each of those 3 groups would have the same number of people. 
Then if 1 of those groups of boys left the room, there would be just two
equal groups, one of boys and 1 or girls.  
So the 5 boys that left must have been one of those groups.  So at first,
there were 10 boys and 5 girls in the room.
    
Using algebra:
 Substitute (2g) for b in the second equation:
Substitute (2g) for b in the second equation:
 
 
 Substitute (5) for g in
Substitute (5) for g in  
 10 boys and 5 girls in the room at first.
Edwin
10 boys and 5 girls in the room at first.
Edwin