Created
February 7, 2022 14:03
-
-
Save lebrancconvas/216fbfb22154fccf83257feb2f278630 to your computer and use it in GitHub Desktop.
This file contains 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
const number = [1,2,3,4,5,6,7,8,9]; | |
const number1 = [1,2,3,4,5,6,7,8,9,10,11,12]; | |
let answer = ""; | |
let setanswer = []; | |
number.map(a => { | |
number.map(b => { | |
number.map(c => { | |
number.map(d => { | |
if(a*b+c-d === 12) { | |
if(a !== b && a !== c && a !== d && b !== c && b !== d && c !== d) { | |
if(true) | |
answer = `${a} - ${b} - ${c} - ${d}`; | |
setanswer.push(answer); | |
} | |
} | |
}) | |
}) | |
}) | |
}) | |
setanswer.map(x => { | |
console.log(x + "\n"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment