Advertisement
Neri0817

Unique pin code

Apr 20th, 2021
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function pinCode(input) {
  2.     let n1 = Number(input[0]);
  3.     let n2 = Number(input[1]);
  4.     let n3 = Number(input[2]);
  5.  
  6.     for (let a = 2; a <= n1; a += 2) {
  7.         for (let b = 2; b <= n2; b++) {
  8.             for (let c = 2; c <= n3; c += 2) {
  9.                 if (a === 2 || a === 3 || a === 5 || a === 7) {
  10.                     console.log(`${a} ${b} ${c}`);
  11.                 }
  12.             }
  13.         }
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement