This is a classic problem known as LIS (longest increasing sequence) that was discussed in CACM decades ago. You can find it in HOW TO SOLVE IT BY COMPUTER by R.G. Dromey (1981) ISBN: 0-13-188862-...
T-SQL PuzzleCommented on: 2 years ago
(November 20, 2012)
The reason for the Hexagons in the original game grid is that this was based on the game Hex, (http://en.wikipedia.org/wiki/Hex_game). It was invented independently by John Nash and Piet Hein. It had...
Solutions to TSQL Challenge – Reoccurring VisitsCommented on: 4 years ago
(July 14, 2011)
I am late to the party, but here goes.
Let's assume we have a the usual Calendar table. Use it to build a table of date pairs. Use the date pairs flag each visitor as a today and/or yesterday...
Logic Puzzle – Dice SubstituteCommented on: 6 years ago
(July 2, 2009)
You are in a British pub, so they will have a set of 6-6 dominoes behind the bar. Pull out the blanks, discard the double. Throw the titles in a hat and draw with replacement to simulate dice....
Throughout this series of posts I’ve taken a somewhat pessimistic view of how SQL Server Agent jobs are managed within most organizations – meaning that most of the code and examples I’ve provided up until this point were based on assumptions about how CHANGE to jobs is managed. That pessimism, to date, has come in two forms:...More
In this series of posts I’ve called out some of the concerns related to SQL Server AlwaysOn Availability Groups and their interaction with SQL Server Agent jobs – both in the form of Batch Jobs (see post #3) and backups....More
When I initially decided to write about AlwaysOn Availability Groups and SQL Server Jobs, I knew I’d have a bunch of different posts on a variety of different topics. To that end, I initially planned on this series of posts being comprised of 3 main parts:...More