Ad
  • Default User Avatar

    Shouldn't for 6 * 6 . Solution should be the below array [ending in 3,2 , rather than ending in 3,1]. I am trying to understand why 1 is not allowed in 3,2 is it becuase the row below it (2,2) is 1 .If this is the reason then why 1 is allowed in 3,3 when row below it i.e 2,3 has a one.Please help me understand .

    1 1 1 1 1 1
    0 0 0 0 0 1
    1 1 1 1 0 1
    1 0 1 1 0 1
    1 0 0 0 0 1
    1 1 1 1 1 1

  • Default User Avatar

    Yes you are right , i checked the scenarios again and solved it. Thanks

  • Default User Avatar

    Shouldn't this array be an invalid arrangment beacuse 2 ships edges are in contact as shown below, my solution is failing because of this scenario, please let me know if I am missing anything-

                                       {{0, 1, 1, 1, 1, 0, 0, 0, 1, 0},
                                        {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                                        {0, 1, 0, 0, 0, 0, 0, 0, 0, 0},
                                        {0, 1, 0, 0, 0, 0, 0, 0, 0, 0},
                                        {0, 0, 1, 0, 1, 0, 0, 0, 0, 0},
                                        {0, 0, 0, 0, 1, 0, 1, 0, 0, 0},
                                        {0, 0, 1, 0, 0, 0, 0, 0, 0, 1},
                                        {0, 0, 0, 0, |1|, |1|, 0, 0, 0, 1},
                                        {0, 0, 0, 0, |1|, |1|, 0, 0, 0, 1},
                                        {0, 0, 0, 0,  0,  |1|, 0, 0, 0, 0}};
    
  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution