Longest Univalue Path


so I started with leetcode 23 weeks ago. My efficiency of solving these problems quite low . either I prepare a code with high complexity or I am not able to completely solve the problem or even not able to touch it. I find it easier after looking into the solution, but not able to crack the solution beforehand. efficient way to prepare for coding interviews ?

@GuptaCoder007 I've had the same issue and what I've decided to do is to take some online courses on algorithms & data structures. There are many concepts that's best learned before diving into these algorithmic type problems. Lookup some courses on Udemy/Coursera.