Visit the Github repo at https://t.co/9uVajINr7L to see an example which demonstrates how changing/turning a data structure might give you a better result, regarding time/space complexity😉
Visit Github repo at https://t.co/m8xCkZLCC5 for some simple samples in JS and at https://t.co/XYc64TEW7W for their Java equivalents (being gradually added 😉)