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.
Very interesting kata.
Good kata, but there is a problem with Swift unit tests and example
func swap(_ s: String, n: Int) -> String { // _ is missed before n
XCTAssertEqual(swap("the quick broWn fox leapt over the fence", 9),
"The QUicK BrowN foX LeaPT ovER thE FenCE")
Description is inconsistent.
Each bit in n will specify whether or not to swap the case
versusbecause 11 is 1011 in binary, so the 1st, 3rd, 4th, 5th, 7th, 8th and 9th alphabetical characters have to be swapped
. You really need to describe this more carefully.You need to replace "func swap(_ s: String, n: Int) -> String" with "func swap(_ s: String, _ n: Int) -> String". Then the error "type of expression is ambiguous without more context" will disappear
Thanks :)
C translation (author inactive)
fixed
the description mentions this now
approved by someone
approved by someone
I got that too, but then worked the kata in xcode playgrounds, copied the entire function back over to the kata, and it worked as it should do.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
On Swift 5.3, no matter what the solution is, compiler gives out "error: type of expression is ambiguous without more context" for every single test case.
Loading more items...