This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:document.body.appendChild( | |
(function(s){ | |
s.setAttribute('contenteditable',''); | |
s.setAttribute('style','display:block; border:1px solid black; width:90%; height:300px; position:fixed; bottom:50px; left:5%; z-index:65536;'); | |
s.setAttribute('onkeydown','event.stopPropagation()'); | |
s.setAttribute('onkeypress','event.stopPropagation()'); | |
s.setAttribute('onkeyup','event.stopPropagation()'); | |
return s; | |
})(document.createElement('style')) | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Напишите функцию, которая из произвольного входящего массива выберет все комбинации чисел, сумма которых будет равняться 10 | |
* | |
* @see http://company.yandex.ru/job/vacancies/dev_int_yaservices.xml | |
* @param {Array} ITEMS | |
* @param {Integer} target | |
* @example findCombinations([ 7, 10, 2, 5, 3, 1 ], 10) => [[7, 2, 1], [7, 3], [10], [2, 5, 3]] | |
* @returns {Array} | |
*/ | |
function findCombinations (ITEMS, target) |