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
addEventListener('fetch', event => { | |
event.respondWith(handleRequest(event.request)) | |
}) | |
async function handleRequest(request) { | |
const headers = { | |
'Access-Control-Allow-Origin': '*', | |
'Content-Type': 'application/json' | |
} |
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
// you can use console.log for debugging purposes, i.e. | |
// console.log('this is a debug message'); | |
// you can use console.log for debugging purposes, i.e. | |
// console.log('this is a debug message'); | |
function solution(A) { | |
// write your code in JavaScript (Node.js 0.12) | |
var counting = []; | |
for ( var i = 0; i < A.length; i++) { | |
if(counting[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, A) { | |
// write your code in JavaScript (Node.js 0.12) | |
var count = new Array(X); | |
for ( var i=0; i < A.length; i++) { | |
var info = { | |
minute : i, | |
count : 1 | |
}; | |
if (!count[A[i]]) | |
count[A[i]] = info; |