# Write a function that takes a string and a substring and # removes the second instance of the substring from the string # without using any built-in functions/methods besides len() # (i.e. you may NOT use .index()). # The substring will be at most three characters long. # # After completing the solution without using built-in functions/methods, # rewrite a function to use built-in functions/methods. # Then, compare both solutions. def removeSecond(l, n): print(removeSecond('bird', 'i')) # bird print(removeSecond('bird', 'x')) # bird print(removeSecond('ibiridi', 'i')) # ibridi print(removeSecond('kiaeb', 'iae')) # kiaeb print(removeSecond('kiaebiaeriaediae', 'iae')) # kiaebriaediae print(removeSecond('kiaebiariaediaeia', 'iae')) # kiaebiardiaeia