PHP and Javascript solutions to moderate challenge #101 - Find A Square (New version)