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: (function() {let gold=$("div.title-subinfo>div:contains('Золото')").closest("tr").find("td:last-child").text();gold=gold.replace(" ",""),gold=gold.replace(",","."),gold=parseFloat(gold).toFixed(2),console.log(gold);let dollar=$("div.title-subinfo>div:contains('Доллар США')").closest("tr").find("td:nth-child(2n)").text();dollar=dollar.replace(" ",""),dollar=dollar.replace(",","."),dollar=parseFloat(dollar).toFixed(2),console.log(dollar),alert("Стоимость золота на сегодня "+(gold/dollar).toFixed(2)+" USD");})(); |
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
function solution(X, A) { | |
if (A.length === 1) { | |
if (A[0] === 1 && X === 1) return 0; | |
else return -1; | |
} | |
i = -1 | |
sumOfArr = 0 | |
sequenceSum = (X * (X+1)) / 2 | |
arrOfFound = [] |
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
function solution(A) { | |
A.sort(function(a,b){return a-b}) | |
count=0 | |
for(i=0; i<A.length; i++){ | |
if(A[i]===i+1){ | |
count++ | |
}else{ | |
break | |
} | |
} |
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
function solution(A) { | |
while(A.length>0){ | |
findEl=A.shift() | |
indexEl=A.indexOf(findEl) | |
if(indexEl>=0){ | |
A.splice(indexEl,1) | |
}else{ | |
return findEl | |
} | |
} |
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
function solution(A, K) { | |
if(A.length%K){ | |
for(let i=0; i<K; i++){ | |
lastNumber=A.pop() | |
A.unshift(lastNumber) | |
} | |
} | |
return A | |
} |
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
function solution(N) { | |
line=N.toString(2) | |
arr=line.split('1') | |
if(arr[arr.length-1]!=''){ | |
arr.pop() | |
} | |
arr.sort() | |
if(arr[arr.length-1]!=''){ | |
return arr[arr.length - 1].length | |
} |
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
function solution(A) { | |
A.sort((a, b) => a > b ? 1 : -1); | |
if(A[0]!==1){ | |
return 1 | |
} | |
for (let i=0; i<A.length-1; i++){ | |
if((parseInt(A[i], 10)+1)!==A[i+1]){ | |
return A[i]+1 | |
} | |
} |
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
function solution(A) { | |
let P=A.length-1, difArr=[] | |
for(let i=1; i<=P; i++){ | |
let LSumm=0, RSumm=0; | |
for(let j=0; j<A.length; j++){ | |
if(j<i){ | |
LSumm+=A[j] | |
} | |
else{ |