sorry if this question was asked before but I looked it up and I couldn\'t figure how to adapt their solutions to mine.
Here is the code, fairly simple :