News for hackers. Stuff that matters.
Re:Why it’s hard for programmers to write a program to flatt... by valine on Friday February 24, 2017 @02:21PM (#13726757)
It took me about 5 minutes to solve this in Swift. My first thought was to use a recursive function that takes an array with a generic type. I'm not sure that would have been my first thought under the stress of an interview. Its very likely I would have frozen and wouldn't have produced anything at all.
Re:Why it’s hard for programmers to write a program to flatt... by collyw on Friday February 24, 2017 @02:27PM (#13726825)
It took me an embarrassingly long 15 minutes in Python. I had already seen the mention of recursion in the description, so I hope I would have realized that it was needed. (I am guessing I probably would have looked at recursion at the point when I realized that there were multiple levels of nesting, and not just one).