Fraudulent Activity Notifications

  • + 2 comments

    I'm asking for help about my python code. (I'll post in the comment) What my code do is following the idea you guys shared in the discussions. ( Don't sort every sliding window & use bisect module to help place new expenditure into the window. ) Without using the bisect module, I do it with two hand-craft functions 'binary_remove' and 'binary_insert', try to do an O(logn) time complexity. But in the test cases, I still fail by timeout at the case 1~5. (The answers are all corrrect when I doing offline). Can someone help me find out what's wrong with my code? Or should I just give up these two hand-craft functions? Thanks a lot.