5 kyu

Perimeter of squares in a rectangle

1,022 of 43,180g964
Description
Loading description...
Mathematics
Algorithms
  • Please sign in or sign up to leave a comment.
  • Bolt71 Avatar

    Absolute dislike for such a task!!! WRITE IN THE TASK CONDITION ALLOWED RANGE n!!!

  • Bigoh20 Avatar

    I don't know why everyone says this is too easy for a 5kyu challenge. I've completed some 3kyu challenges that were easier than this one💀

  • oso0824 Avatar

    The first thing I thought was "Really? This simple?" Then I realized why we were to use BigIntegers. It was a nice way to force me into learning more about kotlin's long variable!

  • Egor318 Avatar

    g964 огромное тебе спасибо за это Ката. Просто потрясающая задача и, когда понимаешь суть проблемы, вникаешь в возможные пути решения, то выбираешь оптимальный и ВСЕ, задача решена. Очень познавательная и интересная Ката. Еще раз огроное спасибо, было класно.

  • PhoneWars Avatar

    This one isn't too hard, but man...I am dumb. Passed the test cases, but just can't figure out the attempted cases.

  • jediflamaster Avatar

    This comment has been deleted.

  • ihabqu Avatar

    Expected: equal to 213265164688 Actual: 7106734480 Random_tests

    Expected: equal to 5219878179714624 Actual: 15446324800

    i pass all tests except these , any help ?

  • justmkfr Avatar

    How would you loop different numbers into the array where you added to find the different lengths? (Fibonacci sequence)

  • Naiten Avatar

    Trying to solve this in C#... Simple brute method worked with sample tests, but timed out on the later test. So i've used the Binet formula which works fine up to n = 10 and fails at n = 100. I've used double to define phi, psi and sqrt(5), and to do phi^n, and apparently that starts to fail in lesser digits on the number. What am I missing here?

  • JohanWiltink Avatar

    JS tests for inputs up to 75. Meanwhile, Haskell is apparently intended to test for inputs up to 120_000 ( but always tests for 1200 because of a bug ).

    JS should update to Node 18.x, use BigInts, and test up to $HUGE.

    ETA: Haskell has been fixed.

  • trashy_incel Avatar

    C fork

    • better assertion messages
    • proper use of the test framework
  • ZakI234 Avatar

    Random test cases have numbers too large for python (SyntaxError: Exceeds the limit (4300) for integer string conversion: value has 15621 digits - Consider hexadecimal for huge integer literals to avoid decimal conversion limits.) and set_int_max_str_digits is needed and downgrading to 3.8. Maybe it's me doing something wrong, I do not know.

  • longinii Avatar

    the code works just fine in vscode but does not work here, and gives a false error.

  • XsSandreiSsX Avatar

    I tried to store all fibanachi numbers in a list, but this was ineffective. And the decision was not made and I decided to make two variables where the last two numbers are stored

  • Dr33mway Avatar

    This comment has been hidden.

  • dawkrish Avatar

    can someone explain why are we doing it for n+1 not for n, am I missing out something ?

  • NobleAmythysT Avatar

    I feel like this is easy for 5 kyu

  • Angrax Avatar

    This comment has been hidden.

  • moon123-newbie Avatar

    Am I wrong or the numbers in the test cases are all wrong??? The first case should be 48 not 80...Can someone help me here???

  • ilikechocolat Avatar

    I am unsure whether this is an issue or a question but for some reason my racket code is not doing the math correctly.

    For example, (((1+sqrt(5))/2)^73)/(sqrt(5) equals 806,515,533,049,393 but my code gets the math wrong by one digit. I am so confused because the math is correct and this is the simplest formula I know got fibbonacci numbers. I don't understand why it is getting the math wrong because the formula is not that computationaly intensive.

    Btw, this problem is also the same in Dr. Racket on my computer. But it is a language problem for sure because the math I am using is a 100% correct.

  • ejini战神 Avatar

    C#: method name should be PascalCase (Please refer to implementation of backward compatibility here )

  • Tymur_Khan Avatar

    Most of the solutions fail if n == 0 and n == 1; You should add a test case for it.

  • leopb_ Avatar

    got an overflow on ocaml on random tests and cant do anything about that

  • thnndnly Avatar

    In the depiciton of the squares the one with the 8 should be on the right not on the left

  • enymowns Avatar

    Its a nice kata first of all, even tho i knew about fibonacci sequence, its a premiere for Java's BigInteger class for me, i am passing the tests but for the last one it takes about 80 seconds for my solution to calculate the number so it times out. Could someone give me some subtle hints to point me in the right direction please? Thanks!

  • JetMake Avatar

    g964 makes the best kata

  • PythonEnjoyer Avatar

    people like to shit on math kata, but i find math fun so these are my favorite. I find mathematics really useful in programming so being able to learn more math is a plus!

  • jbebic Avatar

    This comment has been hidden.

  • captenclaw Avatar

    This comment has been hidden.

  • Alterra Laniakea Avatar

    This comment has been hidden.

  • LunaTMT Avatar

    This comment has been hidden.

  • gleb4dead Avatar

    I hate this math katas, because instead of writing code or thinking about logic of the function. You like a true dumbass trying to figure out the description and this Fibonacci archive that is older than my grandma, instead of just a link to Wikipedia. And you can call me dumb all you want, but I think these "math" katas are the worst way to practice programming.

  • benjathje Avatar

    This comment has been hidden.

  • Damian Roszak Avatar

    Don't use recursive, espacially with c++, it seems c++ is discriminated :P

  • andrejmoltok Avatar

    This comment has been hidden.

  • LS2008 Avatar

    This comment has been hidden.

  • LOLbit Avatar

    This comment has been hidden.

  • LOLbit Avatar

    This comment has been hidden.

  • VaxiZ Avatar

    Idk these "Math" katas are diffrent from other katas because you can have working code but you will not pass it only beacuse it's not fast enough. It's like having a car race you both have cars, you both making the same distance but if your opponent has a ferrari and all you have is opel astra you will still lose even tho you did nothing wrong. It's just annoying.

  • islandDev Avatar

    Enjoyed this kata. Kudos!!

  • akar-0 Avatar
  • Babs1987 Avatar

    This comment has been hidden.

  • Klixel Avatar

    Very easy kata. I think, it should be 6 kyu.

  • KininYg Avatar

    This comment has been hidden.

  • user8562832 Avatar

    This comment has been hidden.

  • Kayden99 Avatar

    This comment has been hidden.

  • UBG7777 Avatar

    This comment has been hidden.

  • dmcherney Avatar

    This comment has been hidden.

  • bear3 Avatar

    Very nice kata. It is great when there is a short, simple solution once you understand the problem.

  • user6800471 Avatar

    Use it blocks for output info about each random case instead of printing the stuff in console

  • user6800471 Avatar

    your random tests are not strong filtering the heavy implementation, e.g. my solution, which passes between 3.2 to 9 sec. Could you up the upper bound to 500000? EDIT: language - python

  • neophyte0110 Avatar

    "The expression (act) == (expr) is false." I'm getting this error for the final test case ,please help!

  • akar-0 Avatar
  • willdebeast04 Avatar

    This comment has been hidden.

  • user1430804 Avatar

    This comment has been hidden.

  • rampdedlizer Avatar

    Large numbers aren't being handled properly, any help ?

  • ejini战神 Avatar
    • Missing return type in TS

    • Typescript 3.3 or above should be enabled

  • wwwkukish Avatar

    This comment has been hidden.

  • hobovsky Avatar

    Scala: sample tests fail with confusing error when user solution throws exception. To fix it, it's enough to apply this little fix:

        def check(n: BigInt, res: BigInt): Unit = {
            it(s"perimeter($n) should be equal to $res") {
                val z = perimeter(n)
                assert(z === res)
            }
        }
    

    Full tests seem to be OK, the problem is only with sample tests.

  • memphis35 Avatar

    Hi, guys. Could anyone please check the random tests in Scala code? My code passed all fixed tests and all random tests if the input argument < 69k, but it falls when the args more than 69k and there is no stacktrace inside the assertion error. If I break my code and run tests again there are many stacktraces with assertion result, including random tests, but like I said, only if the arg less than ~69k

  • gcm Avatar

    For the Dart translation, I think auto-importing dart:math library is misleading.

  • aNOOBisTheGod Avatar

    I think this is 8 kyu kata cause that is too easy. In Python I solved it in 1 minute...

  • MichasCoup Avatar

    This comment has been hidden.

  • jbirkel Avatar

    I hated this program in Java as I felt it overcomplicated the problem forcing the use of BigInteger, but Python was super easy! In hindsight, I felt like this was a great example of how some programming languages have massive benefits in certain situations vs other programming languages. In this case, Java is a headache because of the BigInteger syntax (but BigInteger is necessary for large numbers), but python doesn't need different data types for larger numbers, so in that language there's no need to think too hard about this problem.

  • user2562198 Avatar

    I think this was a good kata because it made me realize how ingrained certain methods to solve a problem are in my mind. Once I tried something simple and different it worked without issues.

  • Oya? Avatar

    good kata, but i think it's 7 kyu

  • AdrianoAntoniev Avatar

    I made a solution using "divide and conquer" fib algorithm. In my test and in kata tests works fine. But when I try via ATTEMPT, it causes error but does not show any error, except "exit code 132"... Does anyone get ths kind of error (blank error XD)?

  • Aidensamuel Avatar

    Thanks for the hint,good kata

  • eequalsmc2 Avatar

    This comment has been hidden.

  • Opabinia Avatar

    Trying to solve this kata in Shell, I wrote a solution that uses an ancient command-line tool called dc, basically a calculator. Then I found out that the Codewars shell environment doesn't have dc loaded :(. Thought I'd post the answer here: dc -e "1sx1sy2sa $1sc lc2-sc [lx ly+ d la+ sa lx sy sx lc 1- d sc _1>Z] sZ lZx la4* p"

  • PLIVAN Avatar

    Nice kata// GOOD

  • nikolabuca Avatar

    This comment has been hidden.

  • catdotjs Avatar

    This comment has been hidden.

  • catdotjs Avatar

    This comment has been hidden.

  • Darkcloud Avatar

    my code works fine with three test case but for 4th test case it was different from my solution i dont know why it showing like that

  • eldesanclemente Avatar

    I pass the three fixed tests (for n = 5, 7, 30) but fail when I try ATTEMPT.

    The issue is that my code takes too long (not efficient!). I'm guessing that the issue is the recursion that I use to find the Fibonacci sequence, but the Fib sequence is, by its very nature, recursive.

    So, my question is: does the program have to be non-recursive in order to pass all the tests?

  • RoboTheTroll Avatar

    This comment has been hidden.

  • YangBin Fan Avatar

    This comment has been hidden.

  • textninja Avatar

    Solid 6kyu. I know this has come up many times before but their ought to be a way to override legacy rankings, especially for kata like this one where there seems to be community consensus.

  • Mikmokki Avatar

    This comment has been hidden.

  • chucky-1 Avatar

    This comment has been hidden.

  • lambolt Avatar

    I don't understand this kata. what does it mean "squares disposed in the same manner as in the drawing:" when applied to arbitrary numbers of squares? what are the rules for how these are placed, do we need to check that these squares can be arranged in any or some special way as a rectangle?

    I mean I now see that maybe its supposed to be a sequence 1,1,2,3,5,8 etc but that's not clearly defined. you could make the same rectangle as shown in the image and swap the 1,1,2,3 with a 1,1,1,4 set of squares. The rectangle image has nothing to do with the specific ordering of those values, that's just one example which could form a 13 x 8 rectangle.

    I think the diagram is just confusing, but I guess it must only be me that thinks this since nobody else asked

  • vokenny Avatar

    This comment has been hidden.

  • johnsbuck Avatar

    Recursion should be allowed in these katas. Simple memoized example below

    def perimeter(n):
        memo = [1, 1]
        fib(n, memo)
        return 4 * sum(memo)
    
    def fib(n, memo=[1, 1]):
        if len(memo) > n:
            return memo[n]
        memo.append(fib(n-1, memo) + fib(n-2, memo))
        return memo[-1]
    
  • hofer01 Avatar

    Nice kata!

  • stuenofotso@gmail.com Avatar

    This comment has been hidden.

  • bri713 Avatar

    This comment has been hidden.

  • minorgoat Avatar

    This comment has been hidden.

  • edyatl Avatar

    This comment has been hidden.

  • Luvexina Avatar

    This comment has been hidden.

  • nero_ Avatar

    This comment has been hidden.

  • pyatsysh Avatar

    This comment has been hidden.

  • noktelfa Avatar

    This comment has been hidden.

  • ziereis Avatar

    This kata is really easy for 5kyu

  • ngayliard1 Avatar

    My python code works for test cases and can do up to perimeter(10000) in about 5 seconds. It's pretty efficient I think, but maybe not good enough? It times out.

  • Voile Avatar

    Edge case n=0 is needed in all language versions since some top solutions fail against this case. And n=0 is a valid input since it represents 1 square.

  • evgeni-nabokov Avatar

    I was thinking: "or this kata is trivial, or I am stupid to understand the task". I guess the kata has complexity of 7 kyu.

  • dalxds Avatar

    This comment has been hidden.

  • mahesh2492 Avatar

    I don't understand the reason why my code is failing. All test cases have been passed and there is no error related to execution time as well.

  • kelevra1493 Avatar

    I can't understand. Why perimeter(7) should return 216? Because my code return 324, and i think its correct. Update: Why we have to multiply by 4? And why we calculate one block of one? we need calculte only 1 block of 1 but we calculate 2 blocks of 1?

  • p41n1n7h3455 Avatar

    This comment has been hidden.

  • JoshTeperman Avatar

    This comment has been hidden.

  • andraantariksa Avatar

    It will be better if the problem statement has a constraint information...

  • Luminux Avatar

    I solved it in java and the main struggle was to figure out how to work with BigInteger. I made a first draft fully expecting it to fail due to timeout since i thought the numbers tested would be huge but it doesn't seem to be the case. Maybe long or some more standard type would be better suited? Anyway pretty good kata which,if nothing else, thought me about BigInteger! :D

  • luk646 Avatar

    This comment has been hidden.

  • Cethannel Avatar

    Having the variable n declared as a BigInteger is preventing the program from running in java.

  • Wlazrad Avatar

    I have problem all 6 tests pass, Max Buffer Size Reached (1.5 MiB Passed: 5 Failed: 0 Exit Code: 137 what is wrong?

  • mantis1999@mail.ru Avatar

    It was perfect exercise to remember info about Fibo rows and their exponential growth too)

  • lebronkahn Avatar

    What should perimeter(1)return? Should there be 2 squares for perimeter(1)?

  • acmoune Avatar

    good kata

  • CoffeeHax17 Avatar

    This comment has been hidden.

  • Nephanae Avatar

    This comment has been hidden.

  • Marielle1337 Avatar

    Some of the solutions proposed works only because perimeter(0) is not tested. Maybe you can add this to the tests ?

  • Marielle1337 Avatar

    I am 7kyu and this exercise is 5kyu. Why I cannot see the solutions, then ?

  • xavierguihot Avatar

    With Scala, is there a way to make this more explicit?: Test Suite Aborted Exception encountered when invoking run on a nested suite - Unable to load a Suite class that was discovered in the runpath: SquaresPerimeterSuite

  • elmoiv Avatar

    This comment has been hidden.

  • gayanw Avatar

    Summing a Fibonacci sequence is harder than I expected.

  • Unnamed Avatar

    The type of n is Scala is BigInt, although it obviously isn't and can't be tested with that big numbers.

  • henrym2 Avatar

    As a novice programmer the use of a BigInteger in Java has completely put me off this Kata. I will finish it at some point but it seems like an unneeded way to complicate the problem, not to mention the confusing manner in which its actually described. As much as I'm sure some people appreciated the "See Fibbonaci sequence" Hint it wouldn't have been needed if it made sense to start with.

  • amarudemonn Avatar

    Why multiply by 4?

  • ba78 Avatar

    It seems to be more simple than it is, I like that the most straightforward solution was not enough for Haskell. :)

  • pepellou Avatar

    Although the intention is clear, I think the drawing is geometrically wrong and should be fixed so the sentence "disposed in the same manner as in the drawing" makes any sense. The big pink square with side length 8 should be on the left of the others to follow the pattern of a geometrical spiral. Otherwise there's no recognisable pattern to understand what "the same manner" is.

  • mcmlevi Avatar

    bit confusing to wrap my head around but after I got the concept, it was suprisingly easy. anyhow a fun kata to try :D

  • Late347 Avatar

    VERY CONFUSING and little bit contradictory instructions ( parameter value and amount of the amountofsquares)

  • CFi6 Avatar

    This is the first kata to actually piss me off.

  • OneLastStop529 Avatar

    What is the Test 6 in Java, I passed 6 tests, but it came back 5 passed ,1 error. I dindn't use recursive call but it still timed out. What is the problem, I've been stuck at this for way too much time....

  • akarmes Avatar

    Although I can choose "Go" as a language for this kata, it doesn't really work.

  • MorganConrad Avatar

    Seems a bit simple for a 5kyu

  • donaldsebleung Avatar

    Objective-C Translation Kumited - please accept :D

  • kanoshy Avatar

    It was very hard to optimize the solution using the concept of indexed global array.

  • khanhnhk Avatar

    This comment has been hidden.

  • lukasowy Avatar

    I have a problem with time of execute code. Is recursion a bad idea to resolve this kata? My code are working correct with the small numbers.

  • snake2 Avatar

    This comment has been hidden.

  • emantas Avatar

    C# here what is the suggested output type? I tried ulong but this strange error occurs: ✘ Expected: 80 But was: 80

    and of course i have overflow on the ultra-big numbers

  • fsrock Avatar

    Horrible kata

  • lukophron Avatar

    You should add bigger numbers in the tests, at least for python, since the naive approach can pass. Or remove "beware of big numbers" from the description. Also, as stated by others, the description is not consistent about the sum asked for.

    Just make things clearer, will be a perfect kata.

  • KingUno Avatar

    This comment has been hidden.

  • mmalkavian Avatar

    So g964.

    ** ABOUT JavaScript **

    5 other users have told you that the random tests in Javascript are wrong and you dismissed them with "other people have passed the kata". It just happens that I have passed the kata in other languages (Python and Java) and I have cross-checked the results.

    To prove you the inconsistency of your random tests, I leave you this screenshot:

    http://oi68.tinypic.com/8zjus4.jpg

    Do you see what's going on here? test case on the right for 20 (that you wrote) expects correctly 114624, but your random test on the left incorrectly expects 300092.

    I believe the only 63 persons who passed this kata, did it when tests were good; 63 persons over 1647 is a bit small for popular Javascript, isn't it?

    ** ABOUT Java **

    IMHO the use of BigInteger object instead of integer primitive type is completely unnecessary for the sake of the kata, let alone using numbers up to 22 digits!

    Basically the Java author forced the user to use ugly object operations instead of standard math, therefore a simple:

    return res*4

    have become an ugly:

    return res.multiply(new BigInteger("4"));

  • Starko Avatar

    Once again, i believe there is something wrong with the test (at least for JS) Here is the output:

    Time: 366ms Passed: 8 Failed: 50 <- ALL Basic tests pass, And ALL random tests fail !? Always! Weird!

    Test Results: Basic tests Completed in 10ms Random numbers Log Input n=1 <-- just to make sure i log input. it is something which value is 1, not a string "1". Just to make sure i have a guard to test for int ✘ It should work for random inputs too - Expected: NaN, instead got: 8

    How could the result of 1 be NaN. All other random test say exactly the same: Input is a number but expected result is NaN.

    What's the deal here. Even if the tests are right and i missing something, i really want to know...

  • Dmytro515 Avatar

    When I want to pass final test I got "This error was caused due to an issue processing the web request, not because of an issue executing your code. Please try again."

  • magnifi Avatar

    Nice Kata. I think there might be inconsitency between the basic tests and the random tests in Javascript. The basic tests expect the solution to be

    S(0) + S(1) + ... S(n+1).
    

    while the random tests expects the solution to be

    S(0) + S(1) + .... S(n).
    

    for example, the basic test expect ƒ(5) to be 80, while the random test for the same number expects 48.

  • zylixz Avatar

    Is there anyway better than memoization for this kata? I kept getting runner.codewars.io Host Error messages(not the time out msg designed to tell you to optimize your code), not sure if it is my code or the server. My RUBY code passed all the basic tests but does not show any result when running all test cases Error msg: This error was caused due to an issue processing the web request, not because of an issue executing your code. Please try again.

  • Starko Avatar

    Have the same issues as others, all my exammple test are fine but all the random ones fail... This is second kata by the same author that produces strange test results

  • bobtrigg Avatar

    This was a pretty easy kata in PHP, and I found the warning about large numbers to be misleading since my code was about 7kyu complexity and refused to fail. Also, it would have helped to explicitly state in the description that n represents a fib sequence (the reference is indirect). Otherwise a satisfying kata.

  • docgunthrop Avatar

    I've come across an interesting situation where if my code incorporates n + 1 number of squares as described the details, then it passes every basic test but fails every random number test. If I set the number to n instead, it passes every random test but fails every basic test.

  • dinglemouse Avatar

    This comment has been hidden.

  • docgunthrop Avatar

    This comment has been hidden.

  • stackcats Avatar

    This comment has been hidden.

  • ekailia Avatar

    Some solutions are quite simple. I believe they would take long time to handle big numbers. What is the biggest number in test cases? Feeling this 5kyu kata is even harder than a 3kyu one, considering big numbers. https://www.codewars.com/kata/the-millionth-fibonacci-kata

  • roderickfung Avatar

    This comment has been hidden.

  • denesnori Avatar

    Hi everyone! I am trying to solve this Kata in Javascript. I have some issues with the random tests..I can't figure out why I get this erros messages. Does anybody have any ideas? Sadly I am clueless...I logged the input numbers to the screen as well.

    Random numbers n= 27 It should work for random inputs too - Expected: NaN, instead got: 3328156 n= 58 It should work for random inputs too - Expected: NaN, instead got: 10018923127840 ....

  • karetyna Avatar

    You should add tests for SumFct.perimeter(BigInteger.valueOf(0)) and SumFct.perimeter(BigInteger.valueOf(1)). Not all solutions will pass them.

  • brandonthimmesch Avatar

    I was able to pass all the basic tests with my code, but keep failing the random number tests. I was reading through the output when I noticed a possible issue:

    I can't post the screenshot of the output; however, I received an error stating that it expected 212. This shouldn't be an attainable number with the fibonnaci sequence. 212 / 4 = 53 the closest number in the sequence would be 55.

    Is this an error in the test code?

  • msachi Avatar

    This comment has been hidden.

  • otamm Avatar

    Good kata, however, this error is outputing in the Javascript version:

    ReferenceError: fib is not defined at perimeters at tests_code at Object.Test.describe

    There's not any mention of a 'fib' variable in the description and I've successfully completed the C# version using the exact same variable names and solution logic, so either I'm missing something or there's a potentially big issue which gets in the way of completing the kata.

  • marko-bekhta Avatar

    For Java version if you are using BigInteger in declaration of the method it'll be better to add corresponding import. Because when you run without adding import you'll receive an error :)

  • Grig_ Avatar

    Can someone explain this for me? Say that S(n) is the nth term of the above sum. So S(0) = 1, S(1) = 1, S(2) = 2, ... , S(5) = 8 What does it mean nth term of the above sum, I understand it in a way that S(5) is the sum of perimeters of 5 such rectangles.

  • maurelio1234 Avatar

    Something is wrong with the description. It says we need to compute S = S(0) + S(1) + ... + S(n), but in fact, it wants S*4.

  • abelmaniquis Avatar

    This comment has been hidden.

  • shankararunachalam Avatar

    This is a good kata. I am a bit torn about its kyu especially after seeing some of this Sensei's other 5 kyu katas :) Nevertheless, a good question that could send people off in a bad path ;)

  • jasonisgraham Avatar

    Speaking on the Clojure version of this kata, I'm having problems getting this test to pass for large n. Locally, my tests pass without running out of heap.

    I created a test for n=77911, and the test passes no problem locally, but I'm met with a "java.lang.OutOfMemoryError: Java heap space" when running on codewars.

    Could this have something to do with how the JVM is configured? If so, do the non-JVM versions of this kata have similar restrictions?

  • JosefC Avatar

    Does anyone know why the exact same code that I copy and paste from my Eclipse doesn't give me the right resuts in this browser,

    but gives the right results in eclipse? I made sure the class names are all correct, but for some reason test 1 works fine but test 2 and 3 the returns are off. In eclipse my

    code works totally fine. Any help appreciated, thanks!

  • Mira-M Avatar

    I really found this helpful for trying to figure out more efficient ways to execute the same code. This exercise also made me "think big" when considering algorithms and the amount of data that needs to be processed. Because of this kata I stumbled upon some helpful information about different data structures, which was also helpful. Thanks to the author!

  • TheEndIsNear Avatar

    Ok, I have written code for this Kata in Python, and have used arrays to compute the Fibonacci numbers. When I use the default test cases, they complete in 21ms.

    A coworker of mine has completed this challenge using Haskell, and is using a less efficient way to compute fibonacci, and it takes 2430 ms.

    When I submit my code, I get the error "Process was terminated. It took longer than 6000ms to complete." But my coworkers code, even though it takes much longer to run, is accepted.

  • Simonas Avatar

    hi, am new here. when i press test button it is success and takes 16ms, if i press submit button i get an error because it is taking more then 6000ms. I dont get it :)

  • spacewalker Avatar

    lovely Kata!!!

  • bkaes Avatar

    This comment has been hidden.

  • Redmega Avatar

    Should include Algorithms in the tags.

  • NaMe613 Avatar

    Nice kata