THE TEAL PICKLE CODING CHALLENGE!! Replace all spaces on a string with ‘%20'. I solved this problem with my lover, Swift. TRY IT 👀
For further actions, you may consider blocking this person and/or reporting abuse
For further actions, you may consider blocking this person and/or reporting abuse
Sarthak Niranjan -
Saddam Hossain -
Yeasin Arafat -
Dhanush -
Top comments (2)
Uhhh...
Or if you wanna go all in:
(Snippets are in Python because I don’t know Swift)
Yeah in Swift 5 the syntax is pretty similar
string.replaceOccurrences(of: “ “, with: “%20”)
In everyday practice, I def use that method.
Typically in interviews, interviewers want to see whether the interviewee understands/can derive the algorithm which makes that method work (hence, all the code 😬🙃)