10

major issue: misunderstanding of exercise you should find the amount k of friends - not the friends within an distanz k major issue: bug for(Pair pair : list){ double d = distance(pair); map.put(d, pair); } if two "pair"s have the same distance you'll lose one result major issue: naming sounds obvious but you should create a Position not a ...


5

Your code looks nice and readable in my opinion; I can understand most of what's going on. A few points I'm unsure about, however: (1) Your exception handling seems a bit weird to me In filestore.py, you catch all exceptions in your __getitem__ method. This is generally bad practice — if there's a specific kind of exception that you're anticipating, then you ...


3

I don't know how the code is scored, but flat is better than nested. If you want to raise an exception, do it early. Consider def __add__(self, data): if len(data) != 4: raise ValueError('improper length on list added') if not all(isinstance(i, float) for i in data[1:]) or not isinstance(data[0], str): raise ValueError('Improper type ...


2

REVIEW As a solution it is simple and performant which is the aim of all good code. However there are many style issues likely due to inexperience Code style review Way too many comments. Many of them stating the obvious, some inaccurate. Comments should only be used when the code can not describe what the code does, and generally when the code is such ...


1

I don't know about how these scores are being figured, so I can't say what would improve your score. Your code looks like an OK "face value" implementation of the spec, with two three details "wrong". The spec doesn't say that the addition operation should modify self, it actually implies that the operation should not modify self. "...


1

As it stands your controller is pretty much pointless since it's the service that decides on the api's output model and status codes. The service is also responsible for the db model transformation, i.e. it converts the db model directly to the api model. However, you have stated that the service is responsible for business logic. It is not setup to do this ...


1

I think your code is more complex than needed for this problem. I will start with your method signature: static void Print(int[] arr,int num,ref int[] carr) You will have to know a lot about your parameters: arr needs to be an array of powers of two and carr has to be an array of 0s. What happens if one calls this method and these two conditions are not ...


Only top voted, non community-wiki answers of a minimum length are eligible