brewersfan1976

seats_in_theater.rb

Sep 23rd, 2016
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.20 KB | None | 0 0
  1. def seatsInTheater(nCols, nRows, col, row)
  2.     total_seats = nCols * nRows
  3.     output = total_seats - (row * nCols)
  4.     output = output - ((col - 1) * (nRows - row))
  5.    
  6.     return output
  7. end
Advertisement
Add Comment
Please, Sign In to add comment