Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function bankNumberGen(m) {
- let a = Number(m[0]);
- let b = String(m[1]);
- let c = String(m[2]);
- let d = String(m[3]);
- let e = Number(m[4]);
- let n = Number(m[5]);
- let validNumCounter = 0;
- for (let i = a; i <= 99; i++) {
- for (let j = b.charCodeAt(0); j <= 'Z'.charCodeAt(0); j++) {
- for (let k = c.charCodeAt(0); k <= 'z'.charCodeAt(0); k++) {
- for (let o = d.charCodeAt(0); o <= 'Z'.charCodeAt(0); o++) {
- for (let p = e; p >= 10; p--) {
- if (i % 10 == 2 && p % 10 == 5) {
- validNumCounter += 1;
- }
- if (validNumCounter == n) {
- console.log
- (`${i}${String.fromCharCode(j)}${String.fromCharCode(k)}${String.fromCharCode(o)}${p}`);
- return;
- }
- }
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment