Can anyone explain the Tester's solution to RHOUSE problem of Jan 2012 contest ?

strong text

//