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.
The F# version I passed the test. But when I attempt I got these errors:
Kata Tests/Null or Empty tests
at Microsoft.FSharp.Collections.ListModule.Tail[T] (Microsoft.FSharp.Collections.FSharpList
1[T] list) [0x0001e] in <58dd0ce1dff9fae1a7450383e10cdd58>:0 at FSI_0001.sumArray (Microsoft.FSharp.Core.FSharpOption
1[T] _arg1) [0x00028] in <6a5124875a2d4163be5140641db980de>:0at FSI_0001+Tests+suite@21-1.Invoke (Microsoft.FSharp.Core.Unit _arg2) [0x0002b] in <6a5124875a2d4163be5140641db980de>:0
at Fuchu.Impl+evalTestList@260-1.Invoke (System.Tuple
2[T1,T2] tupledArg) [0x00028] in <56a815db36d21f70a7450383db15a856>:0 Completed in 0.492400ms Kata Tests/Too few elements tests at Microsoft.FSharp.Primitives.Basics.List.take[T] (System.Int32 n, Microsoft.FSharp.Collections.FSharpList
1[T] l) [0x0003d] in <58dd0ce1dff9fae1a7450383e10cdd58>:0at Microsoft.FSharp.Collections.ListModule.Take[T] (System.Int32 count, Microsoft.FSharp.Collections.FSharpList
1[T] list) [0x00001] in <58dd0ce1dff9fae1a7450383e10cdd58>:0 at FSI_0001.sumArray (Microsoft.FSharp.Core.FSharpOption
1[T] _arg1) [0x0003a] in <6a5124875a2d4163be5140641db980de>:0at FSI_0001+Tests+suite@25-2.Invoke (Microsoft.FSharp.Core.Unit _arg3) [0x0001f] in <6a5124875a2d4163be5140641db980de>:0
at Fuchu.Impl+evalTestList@260-1.Invoke (System.Tuple`2[T1,T2] tupledArg) [0x00028] in <56a815db36d21f70a7450383db15a856>:0
Isn't that what the kata asks?
This solution is incorrect. When pass a list with all negative numbers, it will return 0!
Calm down, this solution is incorrect! When pass a list with all negative numbers to it , it will return 0!!!
Yes, when pass a list with all negative integers to it, it would return 0!!!
Cool!
@Victor Tsui
,Your example list has 4 elements.
It won't work all the time. when the list is [1,1,1,3], it returns 2!
This comment is hidden because it contains spoiler information about the solution
OMG!Amazing!!!!