Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
It is. Description says: Assume the second parameter will be a string holding one of two values: 'value' and 'index'.
So we don't have to consider other cases. That behaviour is undefined, we can return whatever.
Nice ,short, and clean code congratulation !!
This comment is hidden because it contains spoiler information about the solution
amazing @adrian-lui
i mean, yeah, but the task specifically asks you to include your points when calculating the class averange :p
Even when declarative approach is very keen on the eye it introduces a large overhead compared to just using sort with imperative looping... in my case its around 26ms overhead, compared to 0 abstraction solution that is under half of millisecond, its arround 8000% increase in execution time... For more info check my solution.
Adding yourPoints to the array will NOT change the result, if you think about it. It will change the average point but it will not change the fact that you are higher or lower than the average.
one of these days i might actually come up with a good solution haha
what is the equation doing in the Math.min brackets? I don't understand how the 0.05 and 0.25 work.
I feel myself dumb now
Can be done with BigDecimal rather than with String parsing
I added yourPoints to my answer, people just upvote the answers with the least lines so youre not likely to see top answers do it correctly
Nice Code !
This comment is hidden because it contains spoiler information about the solution
Explain why I have an error
Exception in thread "main" java.lang.NumberFormatException: For input string: "8,6667"
at java.base/jdk.internal.math.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2054)
at java.base/jdk.internal.math.FloatingDecimal.parseDouble(FloatingDecimal.java:110)
at java.base/java.lang.Double.parseDouble(Double.java:735)
at Main2.barTriang(Main2.java:14)
at Main2.main(Main2.java:21)
Loading more items...