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.
Thanks for the translation!
I reversed one of the markup changes to the description. The last sentence is English, not code. Using 1,000 rather than 1 000 looks better.
Sorry - fixed.
Replaced
string[]{} by List<
string
> throughout.It's a great idea, but I was able to solve it without really taking the walls into account (except in the sense that they block the path, as an enemy pawn does). Unless you can convince me that they really add something, I think it would be a stronger kata without the walls. To me they are a distraction, and not real chess.
I haven't solved this yet - my question is based on the description. Are the walls necessary? If each wall was replaced by a black pawn, would the problem be basically the same?
The validator compares the user solution with a valid solution, so it's not actually useful in the local environment. If you have a question about any particular test case, you can post it here and I will try to help.
Great job! What did you use to create the images of the boards?
Minor editing suggestions:
Replace "b is ..." by "The board is ...."
Replace ""W" representing the WhiteKing" by ""W" representing the white king".
Replace ""0" representing a square with no pieces on it" by ""0" representing an empty square".
Replace "if the black king is in checkmate return true and false otherwise."
by "Return true if the black king is in checkmate and false otherwise."
I recommend changing the parameter name in the Initial Solution from b to board. Encourage the use of descriptive variable names!
It would be nice if the sample tests showed example of all the various cases: not check, check but king can escape, check but king can capture queen, & mate. Even better would be if the random tests were subdivided into those different types - this would help with debugging.
There are related problems, like Check and Mate? and Is the King in check ?. But by simplifying the board I think you have added something.
Hi ejini战神,
You suggested something on Discord, but I can't remember what exactly it was. Did you want to change the return type to array instead of list?
Regards,
brodiemark
Hi ejini战神,
Do you have any more concerns about the translation?
Regards,
brodiemark
I don't know. I like the style where, if the expected return value is a positive integer, then using a negative integer to indicate invalid input makes the return type consistent.
Thanks!
Do you want to raise the input limit above 4000?
Google translates this as:
Let me suggest one approach. Go through the customers in order by arrival day. For each customer, go through the already allocated rooms. If that customer's arrival day is larger than the largest departure day of any customer who has been previously allocated that room, the customer can go into that room. If no such room exists, create a new room and put the customer there.
This is the basic idea. There are some details that you have to take care of to make it work.
Thanks for noticing! I believe it is fixed (and in the Java version as well).
Can you please provide an example? When I click on “View Solution I see Python code, so I can't tell a lot from that. The problem is only intended to deal with integers, so you don't have to return bigger numbers.
There are certain conditions that imply that there is no m. If you look carefully at the sample tests, those conditions might become clear. I can't really say more without adding a spoiler.
Loading more items...