Skip to content

Instantly share code, notes, and snippets.

// 1D Bag Packing Problem Description:
// There are 1 to 1M Orders with 1 to 100 LineItems each
// Each LineItem has Space S, Quanity Q, and Title
// For each Order O, Pack N LineItems with Space S and Quantity Q into 1 to M Bags with Size S
// Reduce the number of bags used if possible since some arrangments will result in extra bags used
// Ordered by largest bag to smallest bag
// Can be generalized to any application or restaurant situation
const example_order_3_lines = [
{

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database