This file contains 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
04418448768b2d7b786a2955d72a9cd07480553831d04ddfb5e2a14983b495cee40d4cd3a39422e20e03708db2b45dd101fa0403e0d9004760285ae03c655dd38e |
This file contains 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
var count = 0; | |
var b = [1, -2, 0, 1, -2, 1, 0, 1, 1, -5]; | |
var s = []; | |
b.forEach(element => { | |
if (element === 0) { | |
s.push(0); | |
} else if (element === 1) { | |
s.forEach(e => count++); | |
} |
This file contains 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
{ | |
"facebook": { | |
"text": "Do you want to order?", | |
"quick_replies": [{ | |
"content_type": "text", | |
"title": "Yes", | |
"payload": "I want to order", | |
"image_url": "" | |
}, | |
{ |
This file contains 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) { | |
var max = 0; | |
var array = []; | |
for (var i = 0; i < A.length; i++) { | |
if (A[i] > 0) { | |
if (A[i] > max) { | |
max = A[i]; | |
} | |
array[A[i]] = 0; |
This file contains 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) { | |
var n = N.toString(2); | |
var max = 0; | |
var array = []; | |
for (var i = 0; i < n.length; i++) { | |
if (n[i] === "1") array.push(i); | |
} |
This file contains 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 == 0) return A; | |
var B = []; | |
B[0] = A[A.length - 1]; | |
for (var i = 0; i < A.length - 1; i++) { | |
B[i + 1] = A[i]; | |
} |
This file contains 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) { | |
var B = []; | |
var max = 0; | |
for (var i = 0; i < A.length; i++) { | |
if (typeof B[A[i]] === "undefined") { | |
B[A[i]] = 0; | |
if (A[i] > max) max = A[i]; | |
} | |
B[A[i]]++; |
This file contains 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, Y, D) { | |
var jumps = Math.round((Y - X) / D); | |
if (jumps * D + X >= Y) return jumps; | |
else return jumps + 1; | |
} |
This file contains 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) { | |
if (A.length == 0) return 1; | |
var min = 100000; | |
var max = 0; | |
var B = []; | |
for (var i = 0; i < A.length; i++) { | |
B[A[i]] = 0; | |
if (A[i] > max) max = A[i]; | |
if (A[i] < min) min = A[i]; |
This file contains 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) { | |
var min = 99999999999; | |
var total = 0; | |
for (var i = 0; i < A.length; i++) { | |
total += A[i]; | |
} | |
var sum = 0; | |
for (var j = 0; j < A.length - 1; j++) { |
OlderNewer