Ad
  • Custom User Avatar

    You're right, it's about intent! My goal is fundamentals, where other's might be purely to improve practical coding experience.

  • Custom User Avatar

    Valid question, and I don't have an answer. I personally use Stream API to train myself at it, as it would be easier for me to use normal iterations.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar
  • Custom User Avatar

    Not a suggestion. And your solution is O(n^2).

  • Custom User Avatar

    Calling a method which modifies the vector on a const variable

    Wrong number of arguments

    What exactly don't you understand?

  • Custom User Avatar
  • Custom User Avatar

    The description is perfectly clear about the task.

  • Custom User Avatar

    I've got a question about using Linq for almost every search or sort question out there:

    1. What's the performance trade-off to searching manually?
    2. Isn't the whole point of all this to get better at technical interview questions? In which case Linq would most probably not be the accepted answer?

    Even if not for technical interviews, does it not train your brain a lot better to figure out how to search for the answer yourself, as opposed to use an abstracted query library that does all the heavy lifting for you? I kind of feel like it's the equivelant of going to gym and using a machine to lift the weights for you. If your goal is to lift the weight, then fine, but it won't make you stronger.

    The counter argument could be that you specifically want to get better at Linq, which is fine - but then should it not be distinguish that as a completely different type of kata?