Python Forum
Matrix understanding in Python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Matrix understanding in Python
#12
I thought that every human have to "infect" by zombies because the result is a matrix of all 1
 Input:
  [[0, 1, 1, 0, 1],
   [0, 1, 0, 1, 0],
   [0, 0, 0, 0, 1],
   [0, 1, 0, 0, 0]]
  Output: 2
  Why?
  At the end of the 1st hour, the status of the grid:
  [[1, 1, 1, 1, 1],
   [1, 1, 1, 1, 1],
   [0, 1, 0, 1, 1],
   [1, 1, 1, 0, 1]]

  At the end of the 2nd hour, the status of the grid:
  [[1, 1, 1, 1, 1],
   [1, 1, 1, 1, 1],
   [1, 1, 1, 1, 1],
   [1, 1, 1, 1, 1]]
Reply


Messages In This Thread
Matrix understanding in Python - by RavCOder - Nov-13-2019, 11:35 AM
RE: Matrix understanding in Python - by perfringo - Nov-13-2019, 11:51 AM
RE: Matrix understanding in Python - by RavCOder - Nov-13-2019, 12:02 PM
RE: Matrix understanding in Python - by jefsummers - Nov-13-2019, 12:31 PM
RE: Matrix understanding in Python - by perfringo - Nov-13-2019, 12:36 PM
RE: Matrix understanding in Python - by RavCOder - Nov-13-2019, 01:43 PM
RE: Matrix understanding in Python - by perfringo - Nov-13-2019, 02:11 PM
RE: Matrix understanding in Python - by RavCOder - Nov-13-2019, 02:17 PM
RE: Matrix understanding in Python - by perfringo - Nov-13-2019, 02:27 PM
RE: Matrix understanding in Python - by RavCOder - Nov-13-2019, 02:36 PM
RE: Matrix understanding in Python - by perfringo - Nov-13-2019, 03:02 PM
RE: Matrix understanding in Python - by RavCOder - Nov-13-2019, 03:15 PM
RE: Matrix understanding in Python - by perfringo - Nov-14-2019, 07:21 AM
RE: Matrix understanding in Python - by RavCOder - Nov-14-2019, 08:44 AM
RE: Matrix understanding in Python - by perfringo - Nov-14-2019, 12:10 PM
RE: Matrix understanding in Python - by jefsummers - Nov-14-2019, 12:37 PM
RE: Matrix understanding in Python - by perfringo - Nov-14-2019, 02:04 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  define a diagonal matrix from a matrix amalalaoui 1 2,369 May-15-2019, 01:12 PM
Last Post: ichabod801

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020