Consider the following code for string concatenation.
def concat(s1, s2):
result = s1
for ch in s2:
result += ch
return result
How efficient is it? :
- Very efficient.
- Not very efficient because it copies only one character per iteration.
- Very inefficient because it frequently reallocates the contents of result.
- Not very efficient because it is written in python.