Skip to content

Instantly share code, notes, and snippets.

View j-gd's full-sized avatar

J-G Demathieu j-gd

  • San Francisco, CA
View GitHub Profile
@j-gd
j-gd / create_summary_table.md
Last active October 28, 2019 03:48
Create a summary table in SQL

Summary table

Given the following table:

date town price
17/12/2015 SF 5
17/12/2015 AB 3
17/12/2015 SJ 6
17/12/2015 SF 6
/*
A Thief has a knapsack that can hold X lbs of stolen goods
Each stolen good is worth a certain amount of cash, but
the stolen good also weighs a certain weight. This means that
the thief has to pick an optimal combination of items!
The Thief can't pick the same item twice.
What is the maximum worth of goods that the thief can steal?
*/