In this kata, we want to discover a small property of numbers. We say that a number is a dd number if it contains d occurences of a digit d, (d is in [1,9]).
You could return {0, 0}; or return pair<long long, long long> {0, 0};, both works and there are lots of solutions with either one or the other. The other solutions return "answer" where answer has been pre-filled with std::pair <long long, long long> answer(0, 0);.
Usually the Unit test returns unsupported type when there is an error somewhere in your code which is not clear but I have no action on that.
In one of the post you are referencing the guy gave his code; I tried it and saw he got unsupported type on a test where numbers are 2, 10000000,11000000.
Later he found his error...
Print the input to see what happens and be sure there are no errors in the tests otherwise there wouldn't be so many solutions.
This comment is hidden because it contains spoiler information about the solution
This type of metaprogramming is definitely more difficult than 4Kyu.
push_back
isO(1)
, but creating ann
xn
matrix will always beO(n^2)
.And there's no point in
e
when you can write1
s directly to the matrix.please share your error exactly as appear in the console please
Is_Rotation_and_Is_Reflection_Tests
just checks the return values ofis_rotation()
andis_reflection()
for each of the 8 possible values; that's all.If you're still stuck, post your code here (with a Spoiler flag) and I'll try to figure out what the problem is.
The translator is GiacomoSorbi. I have corrected. Could you verify and resolved the issue if it is correct?
Please read that again. Not an issue.
Yes logic is in reverse order; actually my second solution comply with the requirement.
https://www.codewars.com/kata/reviews/57dd95952e6ae3f5d0000054/groups/58ceed4169094e26a500198e
You could
return {0, 0};
orreturn pair<long long, long long> {0, 0};
, both works and there are lots of solutions with either one or the other. The other solutions return "answer" where answer has been pre-filled withstd::pair <long long, long long> answer(0, 0);
.Usually the Unit test returns
unsupported type
when there is an error somewhere in your code which is not clear but I have no action on that.In one of the post you are referencing the guy gave his code; I tried it and saw he got
unsupported type
on a test where numbers are2, 10000000,11000000
.Later he found his error...
Print the input to see what happens and be sure there are no errors in the tests otherwise there wouldn't be so many solutions.