Python program for A modified Naive Pattern Searching algorithm that is optimized for the cases when all characters of pattern are different
def search ( pat , txt ) : NEW_LINE INDENT M = len ( pat ) NEW_LINE N = len ( txt ) NEW_LINE i = 0 NEW_LINE while i <= N - M : NEW_LINE DEDENT