The second first is empty while the second contains a space
while u get this test ，do not use 'str.replace '
This comment is hidden because it contains spoiler information about the solution
Thank you , it worked ! I thinked that the length should be applied before processing the string !
It's complicated ;) but it kinda means that this is yet another C translation with not-so-perfect memory handling. But hey, at least it's documented! :)
Not getting into too much details, this kata basically requires you to allocate the memory in sufficient amount by yourself (for example, with a call to malloc or similar), and return a pointer to the allocated buffer. You do not have to worry about freeing the allocated memory, because test suite will call free, so allocated memory won't leak.
"In C, return a dynamically allocated string that will be freed by the test suite."
Can someone please explain what this means? Or link a resource that explains it? Thanks
you are checking the length to early. You need to process the string before you check for length.
return str.length==0 || str.length>=140 ? false : '#'+str.split(" ").map(x=> x.charAt(0).
my solution sames correct but It can't pass the #CodeWars test , I tried to check (str.length) and I found it 200 , any suggestion
One of the test cases reads as this:
Test.assert_equals(generate_hashtag('Do We have A Hashtag'), '#', 'Expeted a Hashtag (#) at the beginning.')
Can someone explain what is the significance of the  in that test case?
This is the error that I'm getting:
Traceback (most recent call last):
File "train.py", line 12, in
print(generate_hashtag('Do We have A Hashtag'))
TypeError: 'NoneType' object is not subscriptable
Swift translation kumited :) Please review and approve
The description says that the first letter of each word must be capitalized, but it doesn't say you need to change all other letters to lower case.
So this is kinda unexpected in Python at least. People in the comments say it may depend on the language. Strange. A good kata should have a clear description so the description should be clarified.