I would say if it works you don’t have to worry so much. The most important part is that you did come up with a working solution, efficiency in your code comes with time and practice. You just need to apply the conscientiousness you show now to improving your coding in the future.
I used to think the same way when on another website I’d finish a challenge and see the top solutions by other people, sometimes It turned out I was using 10 times more lines of code than the top guys. You will see faster ways to do things as time goes on, and you’ll learn how to better reuse parts of your code as functions.
I think as you take challenges involving checking and manipulating data in multidimensional arrays, you will more fully understand the power of arrays, looping through arrays, and general patterns to this kind of problem solving.