Back to Blog
Are the Java or C++ versions any better? I'm hoping at least the C++ one is since it's OG. See the solution for string to int: def string_to_int(s): return functools.reduce(lamba running_sum, c: running_sum * 10 + (c), s] = '-', 0) * (-1 if s = '-' else 1) Are you kidding me? How is this solution even remotely pedagogical, or even an acceptable solution in a coding interview? - That sounds pretty bad. In fact a lot of the code in this book seems to be written by someone who doesn't seem to grasp pedagogy. ![]() > The authors mention that the code solutions are "Pythonic". And sometimes, the presented solution is completely unintuitive or badly styled - like using global variables instead of passing parameters. In addition, the explanations in many sections are just confusingly worded. I sanity-checked with a friend who does interviews, and he said he would DOCK points for style if a candidate tried to pull something like that. For example, their definition of a BST search is a *one-line* nested ternary conditional (chapter 14, page 202). The authors often use wonky Python tricks at the cost of readability and simplicity. Saw this from some Amazon reviews of the Python version of EPI: > The coding style in many cases is just.
0 Comments
Read More
Leave a Reply. |