Ad
Code
Diff
  • const cinema_auditorium = (spisok2d, ryad) => {
      console.log(spisok2d, ryad);
      let totalsoldtickets = 0;
    
      for(let i = 0; i < spisok2d.length; i++) {
        for(let j = 0; j < spisok2d[i].length; j++) {
          if(spisok2d[i][j] === 1 && i === ryad) {
            totalsoldtickets++;
          }
        }
      }
    
      return totalsoldtickets;
    }
    • const cinema_auditorium = (spisok2D,ryad)=> {
    • console.log(spisok2D,ryad)
    • return 4
    • const cinema_auditorium = (spisok2d, ryad) => {
    • console.log(spisok2d, ryad);
    • let totalsoldtickets = 0;
    • for(let i = 0; i < spisok2d.length; i++) {
    • for(let j = 0; j < spisok2d[i].length; j++) {
    • if(spisok2d[i][j] === 1 && i === ryad) {
    • totalsoldtickets++;
    • }
    • }
    • }
    • return totalsoldtickets;
    • }