I was given a code challenge that I failed on (rather badly) for a junior dev job and its been going through my mind over and over.
The question was: assume N is of length 1-100. The task is to return N as a string.
For example if N = 5 then return "+-+-+" or if N is 3 then retun "+-+"
N was assigned to type Int at the start of the algorithm.
I tried using Java but failing the test I don't see how showing my code will help. All im after is a solution so I can see how it is done and learn from it.
I may use the following languages: Java, Python, C#.
Here is a fiddle. C# is used in the above code.