24 ms·
n is the length of the string. As for why it matters whether it's linear or quadratic, we are assessing the candidates ability to analyze a problem and possibly
by behdad 3y ago
n is the length of the string. As for why it matters whether it's linear or quadratic, we are assessing the candidates ability to analyze a problem and possibly improve an algorithm. It might not matter in the problem at hand.
- sverona 3y agoOkay, yeah, that's fair.
- edflsafoiewq 3y agoSurely there is a longest word in the dictionary, so you can short circuit for any string longer than twice that. So an asymptotic analysis in the length of the string doesn't really make sense.
- jameshart 3y agoWe're assessing the candidates ability to do work that doesn't matter? This is a negative hiring signal you're looking for, right?