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.
I'm sorry, but I don't think my profile has privileges to review and approve translations. I don't see an option that allows it and I can't see the translations you're talking about either.
:-(
Okkk dfhwze.
Now is working ok all the time.
Thaaaaanksss
I have passed the tests trying again and again until in the random tests there were no entries with n > 44 and I was able to submit the solution and it can be seen in "Solutions".
My solution is correct, but it gives an error with n > 44 (and it should not give an error)
dfhwze, with your fix it is now working much better.
Now, the only error is when the input n is greater than 44, which must be truncating something in the tests
For example: Testing n = 45 , it returns Incorrect length Expected 35, but got 1035.
The correct one is mine (1035) but it must be truncating 3 positions and that is why it does not go beyond 999 and says that the correct thing is 035 instead of 1035
Ups.
I am sorry. It is COBOL.
Can someone fix the tests?
Please
There is an error in the test cases when n > 2.
In my program when n = 3 my result is length = 6 and array(1,1,1,1,2,1)
In my program when n = 6 my result is length = 21 and array(1,1,1,1,2,1,1,3,3,1,1,4,6,4,1,1,5,10,10,5,1)
etc...
All my tests have a correct answer, but something is wrong with the test cases because it tells me that it is not correct.
Please, solve the bug.
I have seen another error in the Sample Tests:
move 3 to n
move 6 to el
move 1 to e(1) e(2) e(3) e(4)
move 2 to e(5)
perform doTest
end tests.
It is wrong, the correct one is:
move 3 to n
move 6 to el
move 1 to e(1) e(2) e(3) e(4) e(6)
move 2 to e(5)
perform doTest
end tests.
Thanks monadius.
It is working now.
Please, anyone can review my issue?
If the test case is x = 4, y = 2, the result is 11, because inside there are 8 squares 1x1 and 3 squares 2x2 (total = 8 + 3 = 11). It works correctly.
But, if the test case is x = 2, y = 4, the result must be 11 also (8 squares 1x1 + 3 squares 2x2), but the expected result says it is 10 (WRONG!!!)
In COBOL I don't understand test cases.
My code works correctly when x >= y, but when x < y it doesn't work.
My program returns the same solution when the rectangle is xy or yx, it makes sense because the rotation of the rectangle (vertical or horizontal) should not affect the number of squares that fit inside it.
I don't understand. :-(
Done!
It works.
Thanks monadius.
;-)
There is an error in the COBOL tests.
When variable "sz" is an exact multiple of the length of the input string "s", the last chunk of the result is lost.
A couple of examples.
sz = 9,
s = "381373217506973794" --> length = 18 (= 9 * 2),
Expected = "813732173" --> WRONG (the last 9 characters have been lost),
Actual = "813732173497379605" --> CORRECT.
sz = 6,
s = "896062860682635941347058555738561857516151786557" --> length = 48 (= 6 * 8),
Expected = "960628286068149536470583557385758165161515" --> WRONG (the last 6 characters have been lost),
Actual = "960628286068149536470583557385758165161515755687" --> CORRECT.
For my code to work I had to trick it to truncate that last string.
Now, it works perfectly.
Thanks akar-0
Yes. now, It works perfectly.
Thaaaaaanks
There is a bug in the COBOL tests. Sometimes the expected result is outside the bounds of the length of the input array.
I have included an if in my code at the end of the program to control this bug. That's how I got it to work, but it doesn't make sense.
Loading more items...