j
to be an array, not a string joined by newlines. If you're outputting as an array, and just using j
for nicer formatting, I'm 100% fine with it (but you should probably move it out of the header). But if the question specifically wants a string with newlines, I would consider j
to be cheating.