Py soln using sleep(), simple and fast
This simple solution was faster than 95.4% solutiions (32ms runtime)\n\n\n\nclass Foo:\n#flag variables \n    calledFirst = 0\n    calledSecond = 0\n    def __i
This simple solution was faster than 95.4% solutiions (32ms runtime)\n```\n\n\nclass Foo:\n#flag variables \n    calledFirst = 0\n    calledSecond = 0\n    def __init__(self):\n        pass\n\n\n    def first(self, printFirst: \'Callable[[], None]\') -> None:\n        \n        #print and set flag\n        printFirst()\n        self.calledFirst = 1\n\n\n    def second(self, printSecond: \'Callable[[], None]\') -> None:\n\t#wait for 0.01s and then check for the condition again \n        while(not self.calledFirst):\n            time.sleep(0.01)\n        printSecond()\n\t\t#flag for second function\n        self.calledSecond = 1\n      \n\n    def third(self, printThird: \'Callable[[], None]\') -> None:\n       \n        while(not self.calledSecond):        \n            time.sleep(0.01)\n        printThird()\n        \n      \n```
['Python3']