Ad
  • Default User Avatar

    The complete test data

     1 -1  1  1 -1 -1  1  1 -1 -1 -1  1  1  1  1  1  1  1  1 
     0  0  0 -1 -1  1 -1  0  0  0  0  0  0  0  0  0  0  0  0 
     0  0  0 -1  0  0  0  0  0 -1  0  0  1  0  0  0  0  0  0 
     1 -1 -1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
     0 -1  0  0  0  0  0  0  1  0  0  0  0  0  0  0 -1  0  0 
     0  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  1 
     0 -1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  1  0 
     1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
     0  0  0  0  1  0  0  0  0  0  0  0  0  0  0 -1  0  0  0 
     0  0 -1  0  0  0  0  0  0  0  1 -1  0  0  0  0  0  0  0 
     0  0  0  0  0  0  0  0  0  1  0  0  0  0  0  0  0  0  0 
     0  0  0  0  0  0  0  0  0 -1  0  0  0  0  0  0  0  0  0 
     0  0  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
     1  0  0  0  0  0  0  0  0  0  0  0  0  0 -1  0  0  0  0 
     0  0  0  0  0  0  0  0  0  0  0  0  0 -1  0  0  0  0  0 
     0  0  0  0  0  0  0  0 -1  0  0  0  0  0  0  0  0  0  0 
     0  0  0  0 -1  0  0  0  0  0  0  0  0  0  0  0  0  0  0 
     0  0  0  0  0  0  1  0  0  0  0  0  0  0  0  0  0  0  0 
     0  0  0  0  0  1  0  0  0  0  0  0  0  0  0  0  0  0  0
    

    The expectation ' ' My answer

    League of Legends 	 League of Legends
    Dota 2 	  	  	  	 Dota 2
    Dota 2 	  	  	  	 League of Legends
    League of Legends 	 League of Legends
    League of Legends 	 Dota 2
    Dota 2 	  	  	  	 Dota 2
    League of Legends 	 League of Legends
    League of Legends 	 League of Legends
    League of Legends 	 Dota 2
    League of Legends 	 Dota 2
    League of Legends 	 Dota 2
    Dota 2 	  	  	  	 League of Legends
    Dota 2 	  	  	  	 League of Legends
    League of Legends 	 League of Legends
    Dota 2 	  	  	  	 League of Legends
    Dota 2 	  	  	  	 League of Legends
    Dota 2 	  	  	  	 League of Legends
    League of Legends 	 League of Legends
    Dota 2 	  	  	  	 League of Legends
    
  • Default User Avatar

    🀯Nicely made - but I am lost somewhere!
    Well - in short, my code "works" for the visible tests and not for the random ones - of course 😝
    Given a matrix as:

     1 -1  1  1
     0  0  0 -1
     0  0  0 -1
     1 -1 -1  0
    

    If I understood the rules correctly, the 1 placed third in first row represents that the person indexed 0 and the person indexed 2 know each other in a friendly manner. Because index 0 is always LOL, index 3 should also be LOL.

    However - the result is Dota...

    Where am I wrong??

  • Default User Avatar

    Honestly, I cant get everything right at the first go; well of course. Thanks a lot for the link, I am very sorry that I missed it somewhere before.
    Well, I published this challenge because I just unlocked the ability to do so - I am happy to receive help so fast πŸ™

    When I was writing the challenge, it asked me to upload my solution along. So.... Should I just copy that to the "Test Cases" and perform a random test against my solution?

  • Default User Avatar

    Oh that! It's more of a typo than an issue in my algorithm. Dont worry, you are not supposed to use any mind reading magic.
    Thanks for pointing that out - and poof - it's fixed.

    By the way, it does seem like you read my mind and figured out what I expected in turn - kudos!

  • Default User Avatar

    Probably the worst solution ever, because of method local inner classes 😝.

  • Default User Avatar

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

  • Default User Avatar

    I wrote some good amount of mess to solve it... As far as I understand my own code (which I forgot right after writing) the algorithm seems to be working just fine! Well the results are of cource not correct 😝. Here are a few tests

    tft,^& = 2
    ttftff, |&^&& = 36
    ttftfftft,|&^&&||^ = 23296
    tt, | = 1
    ttt, || = 2
    tttt, ||| = 6
    ttttt, |||| = 24
    

    If anyone has a clue, please help me out 😁.

  • Default User Avatar

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