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.
It's a difficult question. What you need to learn depends on challenges you will face during the trial, your background in computer science, and programming skills. I don't know anything about that.
It would be fine to address this question to the supervisor/manager/administrator/etc. of your preliminary trial. If it isn't possible, you may read any short guide about the C language, data structures and algorithms, for example: http://www.cs.yale.edu/homes/aspnes/classes/223/notes.html, chapters 4, 5, may be 3 (if you use Linux).
But again, it's very difficult to give an advice without any knowledge about the trial, your background and skills.
Hi,
Your description of the solution is correct.
Feel free to ask any questions, and good luck with learning the C language.
Yes, I've added one new test case (medved test) only. It's the only difference.
And I've changed my own solution, of course.
Thanks!
The description of this kata doesn't specify the function call precedence. On the other hand, there aren't tests that depend on it. All tests can be successfully passed in both cases.
So, you can choose any of these options (or implement two versions of the interpreter :) )
C translation has been published.
Could anyone review and approve it, please?
C translation has been published.
Could anyone review and approve it, please?
These 7 test cases have different levels of complexity so a time consumption of different tests varies widely (depends on an algorithm).
In C translation is used only one test case as the basis of random tests to obtain a more stable total time consumption. This is important for 10 random tests.
Of course, for a large number of tests, the total time consumption doesn't depend on the level of complexity of individual tests.
Thank you very much.
I've published update (7 + 10).
Some results:
7 fixed tests + 3 random tests: ~450 ms
7 fixed tests + 10 random tests: ~780 ms
7 fixed tests + 20 random tests: ~1100 ms
All random tests are based on one fixed test ("medium").
I propose to choose the option '7 fixed tests + 10 random tests' with random tests are based on one fixed test.
PS
For my solution there isn't significant difference between the difficulty of fixed tests:
the simplest fixed test: ~32-35 ms
the hardest fixed test: ~62-65 ms
the average result: ~45 ms
Therefore, the difference between the random tests based on one fixed tests and the random tests based on all available fixed tests isn't great.
Are you surprised that C language is faster than JS? :)
I'm sorry if I misunderstood your question.
The 6x6 kata (C translation) has 4 fixed tests and 32 random tests.
There are 3 solutions:
my solution takes ~150 ms to pass all tests.
asm-jaime's solution takes ~800 ms to pass all tests.
zwyx's solution takes more 5 - 7 secons to pass all tests. Sometimes it exceeds the time limit.
If we set 200 random tests (and 4 fixed tests) for the 6x6 kata, then my solution will take ~0.8 second to pass all of them.
If we set ~2900 - 3100 random tests (and 4 fixed tests) for the 6x6 kata, then my solution will fail these tests by time out.
I tried to test solutions from the 6x6 kata for the 7x7 case:
a) fixed test #0 ("medium"): ~500 ms;
b) fixed test #1 ("hard"): ~2200 ms;
c) fixed test #2 ("hard"): time out;
d) fixed test #3 ("very hard"): ~5300 ms;
e) fixed test #4 ("very hard"): time out;
f) fixed test #5 ("very hard"): ~6000 ms;
g) fixed test #6 ("very hard"): time out;
It is an inefficient solution or there is a bug.
asm-jaime's solution requires significant modifications to be used in the 7x7 case.
my solution: if we set 100 random tests, it takes ~5 seconds to pass all tests (fixed and random).
My solutions for the 6x6 and the 7x7 are the same (except one line). See performance data above.
My translation uses all available fixed tests as the basis for the random tests. Python solution uses one fixed test as the basis for the random tests (I can't see the original JS solution).
If you would like the translation to be as comparable as possible to the original, I will use one fixed test ("medium") as the basis for the random tests.
I suggest to set 50 random tests. My solution takes ~2.5 seconds to pass 7 fixed tests and 50 random tests. In this case other people will have enough opportunities to pass these tests and to train their optimization skills.
As I understood, the reference solution performs all tests in less than 10 seconds. My solution satisfies this condition (for C language case).
There are 3 solutions for 6x6 kata (C language):
Loading more items...