Dave Ballantyne has created a blog post that explains winning solution of TSQL Challenge 19. You can find his blog post here.