Ad
  • Custom User Avatar

    What is your approach? If you use doubles instead of big integers you obviously will have precision problems

  • Custom User Avatar

    I don't think it's very realistic. If you drop an egg it surely gets some microtrauma even if it doesn't crack, making it more susceptible to crack in another throw.

  • Custom User Avatar

    I'm only commenting because I saw your comment elsewhere and I wanted to confront with your solution :D
    You also get O(n) complexity where n is the length of array. So for small arrays with big differences between min and max you might be correct but for large arrays and small differences your solution will be mercilessly left behind. I don't know python very well but I'd assume that cost of removing an item from a list is disproportionately more costly than iterating an integer so without array size/number difference constrainst I wouldn't say either solution is better than the other.

  • Custom User Avatar

    Yes, it must be a corner because it is said that '+' means corners.
    The other rule, however, in fact justifies why this example is 'invalid'.

  • Custom User Avatar
    X-----+  
          |  
    X-----+  
          |  
    ------+  
    

    It has been asked before but I can not see answer - why would that be invalid? Sure when you start with the lower X then the first corner is ambiguous but if you start with the top one it's very simple because the second '+' must be a turn

  • Custom User Avatar

    I was stuck on this for a long time because instead of an exception I was getting a timeout... my code went into an infinite loop because the "empty" matrix has one row of zero elements, which is NOT a square.