forked from loiane/javascript-datastructures-algorithms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPacktDataStructuresAlgorithms.min.js
1 lines (1 loc) · 25.5 KB
/
PacktDataStructuresAlgorithms.min.js
1
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("PacktDataStructuresAlgorithms",[],t):"object"==typeof exports?exports.PacktDataStructuresAlgorithms=t():e.PacktDataStructuresAlgorithms=t()}(this,function(){return function(e){function t(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=7)}([function(e,t,n){var i,r,o;!function(n,u){r=[t],i=u,void 0!==(o="function"==typeof i?i.apply(t,r):i)&&(e.exports=o)}(0,function(e){"use strict";function t(e,t){return e===t?0:e<t?i.LESS_THAN:i.BIGGER_THAN}function n(e,t){return e===t}Object.defineProperty(e,"__esModule",{value:!0}),e.defaultCompare=t,e.defaultEquals=n;var i=e.Compare={LESS_THAN:-1,BIGGER_THAN:1}})},function(e,t,n){var i,r,o;!function(n,u){r=[e,t],i=u,void 0!==(o="function"==typeof i?i.apply(t,r):i)&&(e.exports=o)}(0,function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=function(){function e(){n(this,e),this.count=0,this.items={}}return i(e,[{key:"push",value:function(e){this.items[this.count]=e,this.count++}},{key:"pop",value:function(){if(!this.isEmpty()){this.count--;var e=this.items[this.count];return delete this.items[this.count],e}}},{key:"peek",value:function(){if(!this.isEmpty())return this.items[this.count-1]}},{key:"isEmpty",value:function(){return 0===this.count}},{key:"size",value:function(){return this.count}},{key:"clear",value:function(){this.items={},this.count=0}},{key:"toString",value:function(){if(this.isEmpty())return"";for(var e=""+this.items[0],t=1;t<this.count;t++)e=e+","+this.items[t];return e}}]),e}();t.default=r,e.exports=t.default})},function(e,t,n){var i,r,o;!function(u,s){r=[e,t,n(0),n(3)],i=s,void 0!==(o="function"==typeof i?i.apply(t,r):i)&&(e.exports=o)}(0,function(e,t,n,i){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),u=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n.defaultEquals;r(this,e),this.equalsFn=t,this.count=0,this.head=void 0}return o(e,[{key:"push",value:function(e){var t=new i.Node(e),n=void 0;if(null==this.head)this.head=t;else{for(n=this.head;null!=n.next;)n=n.next;n.next=t}this.count++}},{key:"getElementAt",value:function(e){if(e>=0&&e<=this.count){for(var t=this.head,n=0;n<e&&null!=t;n++)t=t.next;return t}}},{key:"insert",value:function(e,t){if(t>=0&&t<=this.count){var n=new i.Node(e);if(0===t){var r=this.head;n.next=r,this.head=n}else{var o=this.getElementAt(t-1);n.next=o.next,o.next=n}return this.count++,!0}return!1}},{key:"removeAt",value:function(e){if(e>=0&&e<this.count){var t=this.head;if(0===e)this.head=t.next;else{var n=this.getElementAt(e-1);t=n.next,n.next=t.next}return this.count--,t.element}}},{key:"remove",value:function(e){var t=this.indexOf(e);return this.removeAt(t)}},{key:"indexOf",value:function(e){for(var t=this.head,n=0;n<this.size()&&null!=t;n++){if(this.equalsFn(e,t.element))return n;t=t.next}return-1}},{key:"isEmpty",value:function(){return 0===this.size()}},{key:"size",value:function(){return this.count}},{key:"getHead",value:function(){return this.head}},{key:"clear",value:function(){this.head=void 0,this.count=0}},{key:"toString",value:function(){if(null==this.head)return"";for(var e=""+this.head.element,t=this.head.next,n=1;n<this.size()&&null!=t;n++)e=e+","+t.element,t=t.next;return e}}]),e}();t.default=u,e.exports=t.default})},function(e,t,n){var i,r,o;!function(n,u){r=[t],i=u,void 0!==(o="function"==typeof i?i.apply(t,r):i)&&(e.exports=o)}(0,function(e){"use strict";function t(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function n(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=e.Node=function e(t,n){i(this,e),this.element=t,this.next=n};e.DoublyNode=function(e){function r(e,n,o){i(this,r);var u=t(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e,n));return u.prev=o,u}return n(r,e),r}(r)})},function(e,t,n){var i,r,o;!function(n,u){r=[e,t],i=u,void 0!==(o="function"==typeof i?i.apply(t,r):i)&&(e.exports=o)}(0,function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=function(){function e(){n(this,e),this.count=0,this.lowestCount=0,this.items={}}return i(e,[{key:"enqueue",value:function(e){this.items[this.count]=e,this.count++}},{key:"dequeue",value:function(){if(!this.isEmpty()){var e=this.items[this.lowestCount];return delete this.items[this.lowestCount],this.lowestCount++,e}}},{key:"peek",value:function(){if(!this.isEmpty())return this.items[this.lowestCount]}},{key:"isEmpty",value:function(){return 0===this.size()}},{key:"clear",value:function(){this.items={},this.count=0,this.lowestCount=0}},{key:"size",value:function(){return this.count-this.lowestCount}},{key:"toString",value:function(){if(this.isEmpty())return"";for(var e=""+this.items[this.lowestCount],t=this.lowestCount+1;t<this.count;t++)e=e+","+this.items[t];return e}}]),e}();t.default=r,e.exports=t.default})},function(e,t,n){var i,r,o;!function(n,u){r=[e,t],i=u,void 0!==(o="function"==typeof i?i.apply(t,r):i)&&(e.exports=o)}(0,function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=function(){function e(){n(this,e),this.count=0,this.lowestCount=0,this.items={}}return i(e,[{key:"addFront",value:function(e){if(this.isEmpty())this.addBack(e);else if(this.lowestCount>0)this.lowestCount--,this.items[this.lowestCount]=e;else{for(var t=this.count;t>0;t--)this.items[t]=this.items[t-1];this.count++,this.items[0]=e}}},{key:"addBack",value:function(e){this.items[this.count]=e,this.count++}},{key:"removeFront",value:function(){if(!this.isEmpty()){var e=this.items[this.lowestCount];return delete this.items[this.lowestCount],this.lowestCount++,e}}},{key:"removeBack",value:function(){if(!this.isEmpty()){this.count--;var e=this.items[this.count];return delete this.items[this.count],e}}},{key:"peekFront",value:function(){if(!this.isEmpty())return this.items[this.lowestCount]}},{key:"peekBack",value:function(){if(!this.isEmpty())return this.items[this.count-1]}},{key:"isEmpty",value:function(){return 0===this.size()}},{key:"clear",value:function(){this.items={},this.count=0,this.lowestCount=0}},{key:"size",value:function(){return this.count-this.lowestCount}},{key:"toString",value:function(){if(this.isEmpty())return"";for(var e=""+this.items[this.lowestCount],t=this.lowestCount+1;t<this.count;t++)e=e+","+this.items[t];return e}}]),e}();t.default=r,e.exports=t.default})},function(e,t,n){var i,r,o;!function(u,s){r=[e,t,n(0),n(2),n(3)],i=s,void 0!==(o="function"==typeof i?i.apply(t,r):i)&&(e.exports=o)}(0,function(e,t,n,i,r){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){return e&&e.__esModule?e:{default:e}}(i),f=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),l=function e(t,n,i){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var u=r.get;if(void 0!==u)return u.call(i)},c=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n.defaultEquals;o(this,t);var i=u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return i.tail=void 0,i}return s(t,e),f(t,[{key:"push",value:function(e){var t=new r.DoublyNode(e);null==this.head?(this.head=t,this.tail=t):(this.tail.next=t,t.prev=this.tail,this.tail=t),this.count++}},{key:"insert",value:function(e,t){if(t>=0&&t<=this.count){var n=new r.DoublyNode(e),i=this.head;if(0===t)null==this.head?(this.head=n,this.tail=n):(n.next=this.head,this.head.prev=n,this.head=n);else if(t===this.count)i=this.tail,i.next=n,n.prev=i,this.tail=n;else{var o=this.getElementAt(t-1);i=o.next,n.next=i,o.next=n,i.prev=n,n.prev=o}return this.count++,!0}return!1}},{key:"removeAt",value:function(e){if(e>=0&&e<this.count){var t=this.head;if(0===e)this.head=this.head.next,1===this.count?this.tail=void 0:this.head.prev=void 0;else if(e===this.count-1)t=this.tail,this.tail=t.prev,this.tail.next=void 0;else{t=this.getElementAt(e);var n=t.prev;n.next=t.next,t.next.prev=n}return this.count--,t.element}}},{key:"indexOf",value:function(e){for(var t=this.head,n=0;null!=t;){if(this.equalsFn(e,t.element))return n;n++,t=t.next}return-1}},{key:"getHead",value:function(){return this.head}},{key:"getTail",value:function(){return this.tail}},{key:"clear",value:function(){l(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"clear",this).call(this),this.tail=void 0}},{key:"toString",value:function(){if(null==this.head)return"";for(var e=""+this.head.element,t=this.head.next;null!=t;)e=e+","+t.element,t=t.next;return e}},{key:"inverseToString",value:function(){if(null==this.tail)return"";for(var e=""+this.tail.element,t=this.tail.prev;null!=t;)e=e+","+t.element,t=t.prev;return e}}]),t}(a.default);t.default=c,e.exports=t.default})},function(e,t,n){var i,r,o;!function(u,s){r=[t,n(8),n(1),n(9),n(10),n(11),n(4),n(5),n(17),n(12),n(2),n(6),n(13),n(14),n(15),n(16),n(0)],i=s,void 0!==(o="function"==typeof i?i.apply(t,r):i)&&(e.exports=o)}(0,function(e,t,n,i,r,o,u,s,a,f,l,c,h,p,d,v,y){"use strict";function m(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(e,"__esModule",{value:!0}),e.Set=e.StackLinkedList=e.SortedLinkedList=e.CircularLinkedList=e.DoublyLinkedList=e.LinkedList=e.palindromeChecker=e.hotPotato=e.Deque=e.Queue=e.parenthesesChecker=e.decimalToBinary=e.baseConverter=e.hanoiStack=e.hanoi=e.Stack=e.StackArray=e.util=void 0,Object.defineProperty(e,"StackArray",{enumerable:!0,get:function(){return m(t).default}}),Object.defineProperty(e,"Stack",{enumerable:!0,get:function(){return m(n).default}}),Object.defineProperty(e,"hanoi",{enumerable:!0,get:function(){return m(i).default}}),Object.defineProperty(e,"hanoiStack",{enumerable:!0,get:function(){return m(i).default}}),Object.defineProperty(e,"baseConverter",{enumerable:!0,get:function(){return m(r).default}}),Object.defineProperty(e,"decimalToBinary",{enumerable:!0,get:function(){return m(r).default}}),Object.defineProperty(e,"parenthesesChecker",{enumerable:!0,get:function(){return m(o).default}}),Object.defineProperty(e,"Queue",{enumerable:!0,get:function(){return m(u).default}}),Object.defineProperty(e,"Deque",{enumerable:!0,get:function(){return m(s).default}}),Object.defineProperty(e,"hotPotato",{enumerable:!0,get:function(){return m(a).default}}),Object.defineProperty(e,"palindromeChecker",{enumerable:!0,get:function(){return m(f).default}}),Object.defineProperty(e,"LinkedList",{enumerable:!0,get:function(){return m(l).default}}),Object.defineProperty(e,"DoublyLinkedList",{enumerable:!0,get:function(){return m(c).default}}),Object.defineProperty(e,"CircularLinkedList",{enumerable:!0,get:function(){return m(h).default}}),Object.defineProperty(e,"SortedLinkedList",{enumerable:!0,get:function(){return m(p).default}}),Object.defineProperty(e,"StackLinkedList",{enumerable:!0,get:function(){return m(d).default}}),Object.defineProperty(e,"Set",{enumerable:!0,get:function(){return m(v).default}});var b=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(y);e.util=b})},function(e,t,n){var i,r,o;!function(n,u){r=[e,t],i=u,void 0!==(o="function"==typeof i?i.apply(t,r):i)&&(e.exports=o)}(0,function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=function(){function e(){n(this,e),this.items=[]}return i(e,[{key:"push",value:function(e){this.items.push(e)}},{key:"pop",value:function(){return this.items.pop()}},{key:"peek",value:function(){return this.items[this.items.length-1]}},{key:"isEmpty",value:function(){return 0===this.items.length}},{key:"size",value:function(){return this.items.length}},{key:"clear",value:function(){this.items=[]}},{key:"toArray",value:function(){return this.items}},{key:"toString",value:function(){return this.items.toString()}}]),e}();t.default=r,e.exports=t.default})},function(e,t,n){var i,r,o;!function(u,s){r=[t,n(1)],i=s,void 0!==(o="function"==typeof i?i.apply(t,r):i)&&(e.exports=o)}(0,function(e,t){"use strict";function n(e,t,i,r,o,u,s){var a=arguments.length>7&&void 0!==arguments[7]?arguments[7]:[];if(e<=0)return a;if(1===e){r.push(t.pop());var f={};f[o]=t.toString(),f[u]=i.toString(),f[s]=r.toString(),a.push(f)}else{n(e-1,t,r,i,o,s,u,a),r.push(t.pop());var l={};l[o]=t.toString(),l[u]=i.toString(),l[s]=r.toString(),a.push(l),n(e-1,i,t,r,u,o,s,a)}return a}function i(e){for(var t=new o.default,i=new o.default,r=new o.default,u=e;u>0;u--)t.push(u);return n(e,t,r,i,"source","helper","dest")}function r(e,t,n,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];return e<=0?o:(1===e?o.push([t,i]):(r(e-1,t,i,n,o),o.push([t,i]),r(e-1,n,t,i,o)),o)}Object.defineProperty(e,"__esModule",{value:!0}),e.hanoiStack=i,e.hanoi=r;var o=function(e){return e&&e.__esModule?e:{default:e}}(t)})},function(e,t,n){var i,r,o;!function(u,s){r=[t,n(1)],i=s,void 0!==(o="function"==typeof i?i.apply(t,r):i)&&(e.exports=o)}(0,function(e,t){"use strict";function n(e){for(var t=new r.default,n=e,i=void 0,o="";n>0;)i=Math.floor(n%2),t.push(i),n=Math.floor(n/2);for(;!t.isEmpty();)o+=t.pop().toString();return o}function i(e,t){var n=new r.default,i=e,o=void 0,u="";if(!(t>=2&&t<=36))return"";for(;i>0;)o=Math.floor(i%t),n.push(o),i=Math.floor(i/t);for(;!n.isEmpty();)u+="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"[n.pop()];return u}Object.defineProperty(e,"__esModule",{value:!0}),e.decimalToBinary=n,e.baseConverter=i;var r=function(e){return e&&e.__esModule?e:{default:e}}(t)})},function(e,t,n){var i,r,o;!function(u,s){r=[t,n(1)],i=s,void 0!==(o="function"==typeof i?i.apply(t,r):i)&&(e.exports=o)}(0,function(e,t){"use strict";function n(e){for(var t=new i.default,n="([{",r=")]}",o=!0,u=0,s=void 0,a=void 0;u<e.length&&o;)s=e.charAt(u),n.indexOf(s)>=0?t.push(s):t.isEmpty()?o=!1:(a=t.pop(),n.indexOf(a)!==r.indexOf(s)&&(o=!1)),u++;return!(!o||!t.isEmpty())}Object.defineProperty(e,"__esModule",{value:!0}),e.parenthesesChecker=n;var i=function(e){return e&&e.__esModule?e:{default:e}}(t)})},function(e,t,n){var i,r,o;!function(u,s){r=[t,n(5)],i=s,void 0!==(o="function"==typeof i?i.apply(t,r):i)&&(e.exports=o)}(0,function(e,t){"use strict";function n(e){if(void 0===e||null===e||null!==e&&0===e.length)return!1;for(var t=new i.default,n=e.toLocaleLowerCase().split(" ").join(""),r=!0,o=void 0,u=void 0,s=0;s<n.length;s++)t.addBack(n.charAt(s));for(;t.size()>1&&r;)o=t.removeFront(),u=t.removeBack(),o!==u&&(r=!1);return r}Object.defineProperty(e,"__esModule",{value:!0}),e.palindromeChecker=n;var i=function(e){return e&&e.__esModule?e:{default:e}}(t)})},function(e,t,n){var i,r,o;!function(u,s){r=[e,t,n(0),n(2),n(3)],i=s,void 0!==(o="function"==typeof i?i.apply(t,r):i)&&(e.exports=o)}(0,function(e,t,n,i,r){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){return e&&e.__esModule?e:{default:e}}(i),f=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),l=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n.defaultEquals;return o(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return s(t,e),f(t,[{key:"push",value:function(e){var t=new r.Node(e),n=void 0;null==this.head?this.head=t:(n=this.getElementAt(this.size()-1),n.next=t),t.next=this.head,this.count++}},{key:"insert",value:function(e,t){if(t>=0&&t<=this.count){var n=new r.Node(e),i=this.head;if(0===t)null==this.head?(this.head=n,n.next=this.head):(n.next=i,i=this.getElementAt(this.size()),this.head=n,i.next=this.head);else{var o=this.getElementAt(t-1);n.next=o.next,o.next=n}return this.count++,!0}return!1}},{key:"removeAt",value:function(e){if(e>=0&&e<this.count){var t=this.head;if(0===e)if(1===this.size())this.head=void 0;else{var n=this.head;t=this.getElementAt(this.size()-1),this.head=this.head.next,t.next=this.head,t=n}else{var i=this.getElementAt(e-1);t=i.next,i.next=t.next}return this.count--,t.element}}}]),t}(a.default);t.default=l,e.exports=t.default})},function(e,t,n){var i,r,o;!function(u,s){r=[e,t,n(0),n(2)],i=s,void 0!==(o="function"==typeof i?i.apply(t,r):i)&&(e.exports=o)}(0,function(e,t,n,i){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(e){return e&&e.__esModule?e:{default:e}}(i),a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),f=function e(t,n,i){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var u=r.get;if(void 0!==u)return u.call(i)},l=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n.defaultEquals,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.defaultCompare;r(this,t);var u=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return u.equalsFn=e,u.compareFn=i,u}return u(t,e),a(t,[{key:"push",value:function(e){if(this.isEmpty())f(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"push",this).call(this,e);else{var n=this.getIndexNextSortedElement(e);f(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insert",this).call(this,e,n)}}},{key:"insert",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(this.isEmpty())return f(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insert",this).call(this,e,0===n?n:0);var i=this.getIndexNextSortedElement(e);return f(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insert",this).call(this,e,i)}},{key:"getIndexNextSortedElement",value:function(e){for(var t=this.head,i=0;i<this.size()&&t;i++){if(this.compareFn(e,t.element)===n.Compare.LESS_THAN)return i;t=t.next}return i}}]),t}(s.default);t.default=l,e.exports=t.default})},function(e,t,n){var i,r,o;!function(u,s){r=[e,t,n(6)],i=s,void 0!==(o="function"==typeof i?i.apply(t,r):i)&&(e.exports=o)}(0,function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(e){return e&&e.__esModule?e:{default:e}}(n),o=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),u=function(){function e(){i(this,e),this.items=new r.default}return o(e,[{key:"push",value:function(e){this.items.push(e)}},{key:"pop",value:function(){if(!this.isEmpty()){return this.items.removeAt(this.size()-1)}}},{key:"peek",value:function(){if(!this.isEmpty())return this.items.getElementAt(this.size()-1).element}},{key:"isEmpty",value:function(){return this.items.isEmpty()}},{key:"size",value:function(){return this.items.size()}},{key:"clear",value:function(){this.items.clear()}},{key:"toString",value:function(){return this.items.toString()}}]),e}();t.default=u,e.exports=t.default})},function(e,t,n){var i,r,o;!function(n,u){r=[e,t],i=u,void 0!==(o="function"==typeof i?i.apply(t,r):i)&&(e.exports=o)}(0,function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=function(){function e(){n(this,e),this.items={}}return i(e,[{key:"add",value:function(e){return!this.has(e)&&(this.items[e]=e,!0)}},{key:"delete",value:function(e){return!!this.has(e)&&(delete this.items[e],!0)}},{key:"has",value:function(e){return Object.prototype.hasOwnProperty.call(this.items,e)}},{key:"values",value:function(){return Object.values(this.items)}},{key:"union",value:function(t){var n=new e;return this.values().forEach(function(e){return n.add(e)}),t.values().forEach(function(e){return n.add(e)}),n}},{key:"intersection",value:function(t){var n=new e,i=this.values(),r=t.values(),o=i,u=r;return r.length-i.length>0&&(o=r,u=i),u.forEach(function(e){o.includes(e)&&n.add(e)}),n}},{key:"difference",value:function(t){var n=new e;return this.values().forEach(function(e){t.has(e)||n.add(e)}),n}},{key:"isSubsetOf",value:function(e){if(this.size()>e.size())return!1;var t=!0;return this.values().every(function(n){return!!e.has(n)||(t=!1,!1)}),t}},{key:"isEmpty",value:function(){return 0===this.size()}},{key:"size",value:function(){return Object.keys(this.items).length}},{key:"clear",value:function(){this.items={}}},{key:"toString",value:function(){if(this.isEmpty())return"";for(var e=this.values(),t=""+e[0],n=1;n<e.length;n++)t=t+","+e[n].toString();return t}}]),e}();t.default=r,e.exports=t.default})},function(e,t,n){var i,r,o;!function(u,s){r=[t,n(4)],i=s,void 0!==(o="function"==typeof i?i.apply(t,r):i)&&(e.exports=o)}(0,function(e,t){"use strict";function n(e,t){for(var n=new i.default,r=[],o=0;o<e.length;o++)n.enqueue(e[o]);for(;n.size()>1;){for(var u=0;u<t;u++)n.enqueue(n.dequeue());r.push(n.dequeue())}return{eliminated:r,winner:n.dequeue()}}Object.defineProperty(e,"__esModule",{value:!0}),e.hotPotato=n;var i=function(e){return e&&e.__esModule?e:{default:e}}(t)})}])});