Last active
January 25, 2017 21:09
-
-
Save kirankumaramruthaluri/2c805c44a4b722e40186013470d5ad64 to your computer and use it in GitHub Desktop.
Hackerrank - Hand shake - Javascript
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
/** | |
* Hackerrank Solution - Handshake | |
*/ | |
function main() { | |
var T = parseInt(readLine()); | |
for(var a0 = 0; a0 < T; a0++){ | |
var N = parseInt(readLine()); | |
console.log(Math.floor(N * (N - 1)/2)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment