I am really interested in diving into leetcode. However, I want a solid foundation on data structures and algorithms being used to solve the problems in Leetcode. Please recommend to me some books/resources which would help me. Thanks
Cormen's, Leiserson's, Rivest's and Stein's Introduction to Algorithms and Data Structures is widely considered a most great book on the topic in question.
That book covers not only the basics, but also topics above the "standard" level of Leetcode exercises. I highly recommend starting with it. After you finish it, I believe the best course of action is to reserach individual topics that cought your interest.
There is one more thing I would like to touch on. A mistake some people make is trying to read those kind of books from cover to cover and only afterwards jump into coding. This approach is, most of the time, very inefficient. Once you learn an algorithm or a data structure, try using it, implementing it, and tweaking it. Experiment with the knowledge you are gathering on your way, rather than trying to isolate it.