First, congrats on getting a working solution without using some very convenient array methods. Yes, it was more work, but I bet you have a good understanding of how this algorithm works
But ya, in the “real world” you would definitely use array methods like join to make this much more readable. For example, you can replace everything after the first for loop with one return statement using join. And using join is not a requirement here. You can use replace with a proper regexp to really shorten the code down to almost nothing.
Now that you have a working solution I don’t see any harm in taking a look at the alternative solutions provided in the hints to get an idea of other ways to solve this challenge. Or, before you do that, try to challenge yourself by rewriting this using a functional approach and only a single return statement.