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.
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 solution doesn't work properly with double input data.
for examlple try volume = 0.027, side = 0.3
You have to consider accuracy range.
Needs random tests ;-)
Beautiful, clear, efficient solution.
Love the way you avoided writing small loops using Linq and string manipulation: you achieve code readability without losing efficiency.
The only for loop remaining was unavoidable, and yet the code remains very clean. Congrats.
¯_(ツ)_/¯
That's cheating.
I like how you "converted" the list to a tuple
The
Stream
you're talking about comes from the definition often used in functional languages, except that nobody else usesStream
in that manner. WhatStream
means by them and every other language is actuallyPipes
in Haskell: A data structure-y thing able to act as aProducer
(generator),Consumer
(iteratee),Pipe
or stuff.Anyways: https://msdn.microsoft.com/en-us/library/system.io.stream(v=vs.110).aspx
The most used
Stream
s in C# areMemoryStream
(a Stream held in memory, for reading from other arbitrary streams that might have be and ) andFileStream
. Lots of other libraries and such implement their ownStream
s too, because data transfer in C# are very often utilized byStream
classes, and thatStream
s are much more widely used than in, say, Java.I'm not too familiar with C#. Could you give some examples?
Don't forget that C# has various
Stream
s too ;-)My solution MinMax also gets time out error.
But there is less than 20K possible positions.
Use a cache !
I believe the "List.append" to be O(x) (the x in xbonacci is the size of the list).
Maybe a Queue is more efficient..
Do the sum is also O(x), memorize the last sum, substract the outgoing value and add the previous result is a clever option.
It should be.
Actually, with laziness the tests doesn't pass.
Loading more items...