Not the best solution, but it works
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nusing System.Threading;\n\npublic class ZeroEvenOdd {\n    private int n;\n    private string pass = "OddZero";\n    \n    public ZeroEvenOdd(int n) {\n        this.n = n;\n    }\n\n    // printNumber(x) outputs "x", where x is an integer.\n    public void Zero(Action<int> printNumber) {\n        for (int i = 0; i < this.n; i++) {\n            while (this.pass != "OddZero" && this.pass != "EvenZero") {}\n            printNumber(0);\n            if (pass == "OddZero") this.pass = "Odd";\n            else this.pass = "Even";\n        }\n    }\n\n    public void Even(Action<int> printNumber) {\n        for (int i = 0; i < (int)Math.Floor((float)this.n / 2.0f); i++) {\n            while (this.pass != "Even") {}\n            printNumber(2 + i * 2);\n            this.pass = "OddZero";\n        }\n    }\n\n    public void Odd(Action<int> printNumber) {\n        for (int i = 0; i < (int)Math.Ceiling((float)this.n / 2.0f); i++) {\n            while (this.pass != "Odd") {}\n            printNumber(1 + i * 2);\n            this.pass = "EvenZero";\n        }\n    }\n}\n```
['C#']