Last active
January 17, 2017 18:57
-
-
Save ooade/9bc3f4c79f38d6c1ed09ec751bae9d0e to your computer and use it in GitHub Desktop.
Hackerrank Week Of Code 28
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 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'); | |
} | |
} |
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 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