Technicaly, the requirement didnt say EXPLICITLY that we could not use built-in function so there is a gray area. So despite this aproach is not "handmade from scracth" is also valid acording the kata definition.
I write my code in a complicated way because I didnt know simpler function.
this is the benefit of practices, you learn what you dont know and it will be added to your experiences.
so, this is wrong. It's clearly explained in the info that your own points are not included in the array. And yet the above code works.
still works... with null values, too
well, this is the best solution. The only thing is now we know kyu should be related to languages ! :)
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This is wrong. $yourPoint should be pushed to $classPoints in order to calculate correct average.
Edit: Ok, not necessary to pass.
Technicaly, the requirement didnt say EXPLICITLY that we could not use built-in function so there is a gray area. So despite this aproach is not "handmade from scracth" is also valid acording the kata definition.
Your code doesn't pass test
$this->assertEquals(true, betterThanAverage([2, 3], 3));
But you not included your points for the average.
Edit:
I see another comment that its the same :)
I write my code in a complicated way because I didnt know simpler function.
this is the benefit of practices, you learn what you dont know and it will be added to your experiences.
а чё всмысле
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Loading more items...