Skip to content

Instantly share code, notes, and snippets.

@ooade
Last active January 17, 2017 18:57
Show Gist options
  • Save ooade/9bc3f4c79f38d6c1ed09ec751bae9d0e to your computer and use it in GitHub Desktop.
Save ooade/9bc3f4c79f38d6c1ed09ec751bae9d0e to your computer and use it in GitHub Desktop.
Hackerrank Week Of Code 28

This file contains hackerrank's week of code 28 solutions 😄

function main() {
var n_temp = readLine().split(' ');
var n = parseInt(n_temp[0]);
var c = parseInt(n_temp[1]);
var m = parseInt(n_temp[2]);
p = readLine().split(' ');
p = p.map(Number);
// My code starts here -->
if (p.some(x => x > c * m)) {
console.log('No');
} else {
console.log('Yes');
}
}
function main() {
var q = parseInt(readLine());
for(var a0 = 0; a0 < q; a0++){
var x = parseInt(readLine());
// My code starts here -->
let count = 0;
for (let a = 1; a < x; a++) {
if ((a ^ x) > x) {
count++;
}
}
console.log(count);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment