Yesterday I was doing some challenges in codewars and I got a challenge where I had to “Create a function with two arguments that will return an array of the first n multiples of x.” At first I did what I usually do in these cases, break down the problem into simple steps to solve it easier.
The thing is even broken down I had to do a lot of steps including using a loop that I knew it will be using a lot of resources. If it is the only way and you can't avoid it then do it that way. But then I thought each database administrator or database system has its functions and different ways to get the job done.
That’s when I got the idea. Codewars uses PostgreSQL as their database system for these challenges, and then I started searching for functions that could help me with this in particular, finally after some research, I found the generate series function that lets you create a series from a number or timestamp, the function accepts an start number a finish number and a step, that’s when a really difficult problem became a really easy one.
That’s why it’s important to know your tool and, think about which is the best tool for the problem that you have.
Maybe if you are using the wrong tool for a problem you can make it even bigger or time / money consuming, or if you don't research on the tool that you are already using, maybe there’s a more easy way to solve the thing that you are facing.
Practicing, learning and continuously improving will make yours and your teammates life easier, so my advice to you is to constantly read and keet up with the new features and advances that are happening in your tools.
So, tell me do you do some katas in codewars to practice?
Did you face a problem like I did?
Tell me if you have any other stories like mine with another language.
Top comments (2)
Great Job my friend
🔥🎉