Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function movieTickets(input) {
- let a1 = Number(input[0]);
- let a2 = Number(input[1]);
- let n = Number(input[2]);
- for (let i = a1; i < a2; i++) {
- for (let x = 1; x < n; x++) {
- for (let y = 1; y <= (n / 2 - 1); y++) {
- if (i % 2 === 1 && (i + x + y) % 2 === 1) {
- console.log(`${String.fromCharCode(i)}-${x}${y}${i}`);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement