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.
Initial
grid
is not extensively tested; every test case is already unique byclues
.There should be test cases with the same
clue
but differentgrid
s.Random tests only consists of a small set of fixed inputs, so it is very easy to hard code against all of them.
End trimming for end digits are inconsistent: 2nd row ending
5
/6
and 3rd row2
expects no trimming but everything else expects trimming.Did it at the end, but... with a shitty solution and it passes...
Should make the output format the same than the entry format: why this weird std::array at the outpout string ??
Unless you want to teach users about building strings, there is no reason why the output needs to be a string. If this kata is supposed to be beyond 7kyu, then the target audience already knows how to do that. There are perfectly good datastructures to represent grids/matrices; strings aren't one of them.
I suspect English may not be your first language (no worries), but this sentence is awkward to parse:
The first four values in the array are to the right of Grid (from top to bottom). The remaining four values are below Grid (from right to left).
A better phrasing might be
"The first four values of the input array will be the target sums for each row, from top to bottom; the last four values will be the target sums for each column, from left to right."
I'd also recommed specifying that the input will always consist of 8 values and the game will be played on an 4x4 grid (i.e., no need to write a solution for an arbitrarily sized board)
This comment is hidden because it contains spoiler information about the solution
I'm 100% I've solved an exact same task in the past.
Ruby 3.0 should be enabled (Refer this for more detail)
Using a built-in operator as a function is a worthless kata idea.