Many, if not most, medium to hard problems require at least 100–150 lines of code. With experience, you can write it, bugfree, in 15 minutes.
It's about thinking ahead and experience.