Perfect square trinomials can be written as (a + b)² = a² + 2ab + b². In this case, we know that a = x so we can write this as x² + 2bx + b². Since we know that 2bx = 24x we can conclude that b = 12, so that means b² = 12 * 12 = 144.
She walked down 2 flights, then up 3 flights. This would cause her to be 1 floor above her floor. So, she would have to walk down 1 flight (hence the negative in the -1) and she would be on her floor.