I wouldn't say that coming up with the KMP algorithm from scratch is easy ~1 hour time. Did companies that asked this question expect applicants to know KMP by heart? Did they expect the applicant to show a naive implementation? Any opinion on this?
@marten2 KMP is quite fundamental just like quickSort. You can think it up in 1 hour? That's quite impressive! Actually it took more than several hours the first time when I met it.
no, I could not think up KMP in one hour! That's why I was asking. Do you know of a list of fundamental algorithms that you should know by heart before going into the coding interview?
@marten2 lhearen.top which is a place where I started to record them these days.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.