Advertisement
ggeorgiev88

pinCodeSolve

Dec 12th, 2022
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function pinCode(input) {
  2.     let firsNum = Number(input[0]);
  3.     let secondNum = Number(input[1]);
  4.     let thirdNum = Number(input[2]);
  5.     let result = ""
  6.     let counter = 0
  7.  
  8.     for (let x = 1; x <= firsNum; x++) {
  9.         if (x % 2 === 0) {
  10.             for (let y = 1; y <= secondNum; y++) {
  11.                 switch (y) {
  12.                     case 2:
  13.                     case 3:
  14.                     case 5:
  15.                     case 7:; break;
  16.                     default:
  17.                         continue;
  18.                 }
  19.                 for (let z = 1; z <= thirdNum; z++) {
  20.                     if (z % 2 === 0) {
  21.                         result =`${x}${y}${z}`
  22.                         console.log(result);
  23.                        
  24.                     }
  25.                 }
  26.             }
  27.  
  28.         }
  29.  
  30.  
  31.     }
  32. }
  33.  
  34. pinCode([
  35.     "8",
  36.     "2",
  37.     "8"])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement