Java with semaphore faster than 100%
\nclass ZeroEvenOdd {\n    private int n;\n    private int i = 1;\n    private int lengthOfSeries;\n    private Semaphore z,e,o;\n    public ZeroEvenOdd(int n) 
```\nclass ZeroEvenOdd {\n    private int n;\n    private int i = 1;\n    private int lengthOfSeries;\n    private Semaphore z,e,o;\n    public ZeroEvenOdd(int n) {\n        this.n = n;\n        lengthOfSeries = 2 * n;\n        z = new Semaphore(1);\n        e = new Semaphore(0);\n        o = new Semaphore(0); \n    }\n\n    // printNumber.accept(x) outputs "x", where x is an integer.\n    public void zero(IntConsumer printNumber) throws InterruptedException {\n        while(true) {\n            z.acquire();\n            if(lengthOfSeries == 0) {\n                e.release();\n                o.release();\n                break;\n            }\n            printNumber.accept(0);\n            lengthOfSeries--;\n            if(i%2==0) {\n                e.release();\n            } else {\n                o.release();\n            }\n        }\n    }\n\n    public void even(IntConsumer printNumber) throws InterruptedException {\n        while(true) {\n            e.acquire();\n            if(lengthOfSeries == 0) {\n                z.release();\n                break;\n            }\n            printNumber.accept(i);\n            i++;\n            lengthOfSeries--;\n            z.release();\n        }\n    }\n\n    public void odd(IntConsumer printNumber) throws InterruptedException {\n        while(true) {\n            o.acquire();\n            if(lengthOfSeries == 0) {\n                z.release();\n                break;\n            }\n            printNumber.accept(i);\n            i++;\n            lengthOfSeries--;\n            z.release();\n        }\n    }\n}\n```
[]