Advertisement
Kamend1

Untitled

Mar 6th, 2025
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function solve (n) {
  2.     let numString = n.toString();
  3.     let rowString = (numString + ' ').repeat(n).trim();
  4.     let rowArr = rowString.split(' ');
  5.  
  6.     for (let i = 0; i < n; i++) {
  7.         console.log(rowArr.join(' '));
  8.     }
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement