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.
lua version of ternary operator
Too good!
Beautiful and fast solution.
7999
Can someone elaborate on how this works? I don't quite understand patterns and character classes
Approved
damn, i knew it is possible to solve like this! Great solution!
Nice, I got the same
Nice to find out in this way that the uppercase version of an character class means not.
%S means all non white space characters.
The same could have been achieved with %a which means all characters.
Anyways, good job mate!
Why don't you include the parameter in the solution method?
Your solution for median time is really cool. I simply halfed it and then floored one and ceiled the other, which isn't as cool as your solution. I also like the way you do format strings, putting parethesis around a string and then calling format with it. I think it looks nicer than
string.format("")
If there was one thing I would change it is that you don't store the size of times. You only need to calculate it once since you don't change its size after you fill it. You used
#times
in 5 different places without the size ever changing. You could have used it once and put it in a variable, and then used the variable.The other thing I really liked about your solution was how you added the sums together while retrieving them so that you could calculate the mean without a seperate for loop for adding all the sums together.
One thing I didn't like so much was that you used
times\[#times+1] = time
instead oftable.insert(times, time)
The last thing that I thought you did better was put the format function outside of the main function, I put it inside, meaning I was recreating the format function with every call of the main function.
Approved
describe
block of random testsCan someone please explain the syntax for me? I can't search about it (I don't know the exact keyword to search).
Loading more items...