Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function santaHelper(n, m, s) {
- let result = '';
- for (let i = m; i >= n; i--) {
- if (i % 2 === 0 && i % 3 === 0) {
- if (i === s) {
- break;
- } else {
- result += `${i} `;
- }
- }
- }
- console.log(result);
- }
Advertisement
Add Comment
Please, Sign In to add comment