Javascript solution (math)
Since both kinds of burgers require 1 cheese slice, in total there has to be cheeseSlices number of burgers.\n\n4jumbo + 2small = tomatoSlices (1)\njumbo + smal
Since both kinds of burgers require 1 cheese slice, in total there has to be ```cheeseSlices``` number of burgers.\n```\n4jumbo + 2small = tomatoSlices (1)\njumbo + small = cheeseSlices\nOR \n2jumbo + 2small = 2cheeseSlices (2)\n\nSubtracting (2) from (1) we have:\n2jumbo = tomatoSlices - 2cheeseSlices\n\njumbo = (tomatoSlices - 2cheeseSlices) / 2\nsmall = cheeseSlices - jumbo\n```\nAnd of course both of them have to be integers >= 0\n```\nvar numOfBurgers = function(tomatoSlices, cheeseSlices) {\n  let jumbo = (tomatoSlices - 2 * cheeseSlices) / 2;\n  let small = cheeseSlices - jumbo;\n  return jumbo >= 0 && small >= 0 && jumbo % 1 == 0 ? [jumbo, small] : [];\n};\n```\n
['Math', 'JavaScript']