3 ms·
Experience. You "should" have been able to get the first one, I think the other two are pretty debatable as they require knowledge you might have to research f
by nebulous1 7y ago
Experience. You "should" have been able to get the first one, I think the other two are pretty debatable as they require knowledge you might have to research first if you didn't already know about perfect numbers or at least some of the complexities of unicode.
As far as the first one goes, you could go through some of the questions on https://codesignal.com/ https://codesignal.com/ . They're geared towards interview practice, but ignoring that they provide reasonable problems, a decent environment to write code in and after you get your solution accepted you'll be able to access other solutions to get new ideas. The aim here is just to learn how to think through a problem and allow your brain start to make connections that it wasn't making before.
- misiti3780 7y agoyes, the first one was not hard.
- misiti3780 7y agothanks!
- pmiller2 7y agoFor the perfect number question, you can always just argue that precomputing a 512 MiB bit array that has 1 in position n if n is a perfect number, then indexing into that bit array is O(1). Because the range is constrained, you don't need to know anything about perfect numbers to come up with this.