Ad
  • Custom User Avatar

    u may cal the all arrangements, but some arrangements are written the same.
    in the case(1100 , &^|), the arrangemnt &|^ and |&^ are written the same as(( 1 & 1 ) ^ ( 0 | 0 )).
    this may result in extra cnts.

  • Custom User Avatar
  • Custom User Avatar

    Maybe you're misinterpreting the logs, IDK. The result for the first 4x4 matrix should be ['League of Legends', 'Dota 2', 'League of Legends', 'League of Legends'] (according to my solution).

  • 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!

  • Custom User Avatar

    Assert.assertEquals("2 * 2", BasePrime.factorize(4))

    Assert.assertEquals("1 * 5 + 1 * 1", BasePrime.factorize(6))
    Assert.assertEquals("1 * 7 + 1 * 1", BasePrime.factorize(8))
    Assert.assertEquals("1 * 19 + 1 * 1", BasePrime.factorize(20))
    Assert.assertEquals("1 * 79 + 1 * 1", BasePrime.factorize(80))

    This makes no sense. Either BasePrime.factorize(4) should result in 1 * 3 + 1 * 1 to follow the same pattern, or all the other test cases should be changed to get rid of the "+ 1 * 1" part and have a correct factorization:

    6  == 3 + 3
    8  == 5 + 3
    20 == 17 + 3
    80 == 73 + 7
    

    Also, this behavior is not even explained anywhere - the author wrote a wrong algorithm and expects everybody to read his mind to know how to solve this.

  • Default User Avatar

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

  • 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