Closed labdmitriy closed 1 year ago
Thanks again!
Amazing!
@labdmitriy apologies for the long delay with this issue. I'm working on it at the moment. I reviewed point one, which I though was a mistake. I double checked and it makes sense to me.
Looking at point 4, I see that the example shows that avg([2, 5, 12, 98], ut=12) == avg([2, 5, 12])
, that is the value of ut
should be included in the filtered list.
So, just to double check, is your point that the implementation of the test is different from the example? Thanks!
@labdmitriy I added your implementation to the project. I also briefly discussed performances and style. Thanks!
Hi Leonardo,
I followed Step 9 and at first tried to implement it myself, compared with your implementation and made some notes:
lt
(5) andut
(12) which are different from the values in the implementation (2 and 98 accordingly)Your final implementation:
has some properties which probably can be improved:
len()
function can't be used with generators.I added test for generators at first:
Then I implemented the method which also accepts generators, does not copy iterable and requires only 1 pass:
Thank you.