1
var NumberContainers = function () {6
NumberContainers.prototype.change = function (index, number) {7
if (this.global[index]) {8
for (var key in this.obj) {9
let ind = this.obj[key].indexOf(index);11
this.obj[key].splice(ind, 1);12
if (this.obj[number]) this.obj[number].push(index);13
else this.obj[number] = [index];15
this.global[index] = 1;21
if (this.obj[number]) this.obj[number].push(index);22
else this.obj[number] = [index];23
this.global[index] = 1;26
NumberContainers.prototype.find = function (number) {27
if (this.obj[number]) {28
if (this.obj[number].length == 0) return -1;29
else return Math.min(...this.obj[number]);