Last active
January 22, 2017 11:26
-
-
Save kirankumaramruthaluri/627b82e703966c54095f6baa45296396 to your computer and use it in GitHub Desktop.
Hackerrank - find a point
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 findPoint(input) { | |
var data = input.split("\n") | |
var n = data[0]; | |
for (var i = 1 ; i <= n; i += 1) { | |
var pq = data[i].match(/\d+/g).map(Number); | |
console.log((pq[2] + (pq[2] - pq[0])) + " " + (pq[3] + (pq[3] - pq[1]))); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment