Sort 134 Discussions, By:
Please Login in order to post a comment
In Scala the line
println ( list + "\n" )
must be removed.
yes, since the result is then outputed twice, making the tests fail
Yes, but you can change the return type of the function f to String instead.
lol I tried to fix that by inserting
instead :) Thanks for the hint
seems broken on elixir as well
It passes when I run the code, but fails all the tests when I submit it.
I'm able to pass in Elixir. Do you want to try it again and see if you're still having an issue? Make sure you're printing a space/comma/semicolon-separated list.
Looks like test cases #1 and #2 are still broken. These cases expect an integer number as an output but it has to be a list instead.
Confirmed this -- my code passes all the test cases but #1 and #2, and when I "purchase" test case #2, it indicates that the input and output should both be the integer X -- not a list of length X.
Sorry something still seems weird. Testcase 1 passes when "running" the code, but then it fails when "submitting" it.
Still broken!! Seems like the internal mechanism is counting the number of items in the list, which it uses to assert the test results. So output should be a list so it counts the number of elements. Purchased all test cases and for some wierd reason, even though testcase #1 and #2 fail, seems like #3 and #4 pass, and the output is an integer (total number of elements in the list) just like in the first 2.
...was using IO.inspect without options, thats why it was failing, since inspect does not show the whole list if its too long, passing limit: :infinity to the inspect function's options fixed it. Nice!
fn n = [1..n]
I was getting Wrong answer writing it like this. Rather fn n = [1..n-1] was accepted as solution
Since the content of the array was not specified, I returned a list of all prime numbers :-)
primes :: [Integer]
primes = let s l = head l : s [n | n <- tail l, n mod head l /= 0] in s [2..]
fn n = take n primes
I'm getting the following compile message in Scala, regardless of how I write it:
warning: there was one deprecation warning; re-run with -deprecation for details
one warning found
I had the same message.
Me, too. I think it's a bug in python scripts that run on Server . Foget my Bad English
def f(num:Int) : List[Int] = if(num==0) List() else num::f(num-1)
I'm sure that's right
Is the checker broken for clojure? Input is 10, expected output is 10?
I believe expected output is a list of ten elements. This is unclear in the problem statement, but a list of ten elements satisfies the checker for Scala.
It's not broken. More than that, there's a one-word solution on Clojure ;D
Thanks all. I solved it the first time using one of the one-word solutions in Clojure the first time around, although I think it defeats the spirit of some of these questions.
Try it again, I've made some corrections to the checker.
it does stil enforce me to print List as object. ex: List(1,2,3,4..)
and there is no way to print like is required