Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function challengeTheWedding(input) {
- let maleNumber = Number(input[0]);
- let femaleNumber = Number(input[1]);
- let tableNumber = Number(input[2]);
- let print = '';
- for (let i = 1; i <= maleNumber; i++) {
- for (let k = 1; k <= femaleNumber; k++) {
- if (tableNumber === 0) {
- break;
- }
- print += `(${ i} <-> ${ k}) `;
- tableNumber--;
- }
- }
- console.log(print);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement