How did you solve this one @keshav ?
In competitive programming reusing arrays is fine, as long as you account for old values in the array. e.g when I reuse my 'vis' array I usually set everything to false and then use it again. Example: USA Computing Olympiad In this problem I reset my 'vis' array and run bfs multiple times.
I agree with Keshav, learncpp is really good stuff. Once you grasp basics just googling 4-5 different random websites for one topic usually does the trick. (If you know exactly what you want to learn)
A computer science portal for geeks - GeeksforGeeks
Data Science Tutorials - Topcoder Tutorials
There are some other websites but which ones to use depend on what you are learning. Commonlounge is always good too :)