Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Count Substring Occurrences by kazuki.h
def count_occurrences(main_str, sub_str): return sum(sub_str.lower() == main_str.lower()[i:i+len(sub_str)] for i in range(len(main_str)-len(sub_str)+1))
March 30, 2024