Q:

Staircase Problem Swift print "#" n and n-1 times

Attempting to do the Staircase problem on Hackerrank and came up with a solution such as this; 
 import Foundation

 func staircase(n: Int) -> Void {

   var tag = "#"
   var i = 0
   while i < (n) {
     print( tag)
     tag += "#"
     i = i + 1
 }
}

expected output
my output
I understand that the difference is that the 7th line is empty and thats why I am getting an error. But dont quite understand the logic behind getting that extra line. 

A:

The terminator for print is a newline ("\n") by default.
To avoid newline 
print(tag, terminator: "")

