Skip to content

Instantly share code, notes, and snippets.

@Arxero
Created January 25, 2019 18:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Arxero/d3b94d0fbe897ae3d1a227b3244120a9 to your computer and use it in GitHub Desktop.
Save Arxero/d3b94d0fbe897ae3d1a227b3244120a9 to your computer and use it in GitHub Desktop.
function solution(n1, n2, n3) {
if (n1 > n2 && n1 > n3) {
console.log(n1)
if (n2 > n3) {
console.log(n2)
console.log(n3)
} else {
console.log(n3)
console.log(n2)
}
} else if (n2 > n1 && n2 > n3) {
console.log(n2)
if (n1 > n3) {
console.log(n1)
console.log(n3)
} else {
console.log(n3)
console.log(n2)
}
} else if (n3 > n1 && n3 > n2) {
console.log(n3)
if (n2 > n1) {
console.log(n2)
console.log(n1)
} else {
console.log(n1)
console.log(n2)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment