I'm trying to do the following in either python or javascript (whichever is faster):
Today I'm doing something like this:
for element in [ii]:
check if [ii] is a substring of [i]
if yes, then:
store the corresponding category from [iii]
end loop
else:
continue loop
The problem with this is that when I'm doing this over a lot of strings (e.g., a list of things in item [i]) it takes a super long time.
Does anyone have an algorithm / approach that can make this faster?