5 kyu

Count chains of ones in subsequences

14 of 19dramforever
Description
Loading description...
Algorithms
Performance
  • Please sign in or sign up to leave a comment.
  • Blind4Basics Avatar

    would be nice/useful to have a sample test like "1100011100111".

  • ZED.CWT Avatar

    Java Translation Note to people who are going to translate it into Python: Python is, well, well known slow. I tried my best but performing a 2e6 test still cost 600ms... Consider one can spawn any script in Python (like invoke a node script), it will give too much time for challengers (or not enough time)... So i decided not to translate it into Python.... If someone is good enough in Python optimization, please try do it o_O

  • ZED.CWT Avatar

    Did YOU mod? ;-)

    For input 10001111001010100100111111010111011001001100000110 - Expected: 4949188442, instead got: 654221146
    For input 00000010010110110110010101011011011101111011010001 - Expected: 6967022016, instead got: 2672054720
    For input 00100100010100100001111001110110101011010111000011 - Expected: 7101747860, instead got: 2806780564
    
  • ZED.CWT Avatar

    Your random tests is at least 200 length... Could you please kindly add some shorter cases (10, 20...) to make it easier to debug...