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.
What i mean is that I do not know exactly, but I really doubt that it's an issue with runner or Codewars environment. If it were Codewars fault, then the space would be added always, and not only when the variable is uninitlized, right? I was able to fix your solution just by adding three characters to it. I added
= ""
and it worked.Having to choose between some mysterious bug in Codewars and an error caused by an uninitialized variable, I'd bet on the latter, or maybe some other thing I dont understand yet, like some syntax clash or something.
I checked some other solutions, and checked reference solution and checked your solution after my change, all of them work. Currently the only problem is with your solution, which contains some suspicious syntactic construct i dont exactly understand (because I'm too noob with Powershell), but seems to be a culprit and cause of your problems.
Your solution works for me if I replace line 5 with following:
$bestWord = ''
I do not know PowerShell too well so I do not know whether it's a problem with your solution and some kind of uninitialized variable, or with Codewars setup.
Spaces don't appear out of nowhere, and compilers on CW aren't special either. Based on that, you'll have to make conclusions on your own.
I'd classify that as programmer's mistake, but that's just me. Of course, if you were able to reproduce this: by showing the input, your output, expected output, and the reason it's wrong - then it could become an actual issue. Given that powershell isn't that that popular, it's certainly possible, but there has to be proof and not just words.
Your code not doing what you expect is not a kata issue. Please read this: https://docs.codewars.com/training/troubleshooting/
Avoid this kind of operations:
a/b/c
when possible.