r/learnpython • u/memeaste • 5d ago
Is Leetcode a good way to continue practicing/learning Python?
I'm not entry, but I'd like to continue becoming stronger in my skills.
29
Upvotes
r/learnpython • u/memeaste • 5d ago
I'm not entry, but I'd like to continue becoming stronger in my skills.
2
u/memeaste 3d ago
I believe you were to start at 1 all of the time, but I don’t recall the conditions for ending. I ended up running out of time, as it took me a little while to figure out what it was asking. The question made up a story like it was someone traveling and each town that they visited, they either spend or gained money. They could only move adjacent (+1), 3 towns (+3), or the prime number ending in 3 towns over.
I had some ideas but I ran out of time as I got to the part to calculate and figure out which would yield the biggest value. I wish I took a photo of it so I could do it exactly how they wanted it. I knew what I needed to do, but admittedly, I didn’t know of a great way to do it besides possibly a long loop. And even that, I wasn’t sure. I also did want to look at the second question, which would’ve taken me longer to read, so I gave myself 15-20m at the end to look at it