Accepted :relaxed:

with string and string builder implementation to overcome the time limit exceeded error.