Skip to content

Instantly share code, notes, and snippets.

@McLarenCollege
Created September 14, 2021 10:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save McLarenCollege/9d7f772b9150510d7351a7bd43a1039e to your computer and use it in GitHub Desktop.
Save McLarenCollege/9d7f772b9150510d7351a7bd43a1039e to your computer and use it in GitHub Desktop.
Printer Levels

Given an object of how many more pages each ink color can print, output the maximum number of pages the printer can print before any of the colors run out.

Examples

function inkLevels(obj){
// write your code here
}
console.log(inkLevels({
  "cyan": 23,
  "magenta": 12,
  "yellow": 10
})); // 10

console.log(inkLevels({
  "cyan": 432,
  "magenta": 543,
  "yellow": 777
}));// 432

console.log(inkLevels({
  "cyan": 700,
  "magenta": 700,
  "yellow": 0
}));// 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment