Skip to content

Instantly share code, notes, and snippets.

@eqdw
Last active January 29, 2023 16:07
Show Gist options
  • Save eqdw/ffd5e189fb9da1bd6bb769f2504cc5ed to your computer and use it in GitHub Desktop.
Save eqdw/ffd5e189fb9da1bd6bb769f2504cc5ed to your computer and use it in GitHub Desktop.
STRINGS = ... # dictionary list

SUPERSTRINGS = ... # list of words to check


def check_string(superstring, STRINGS)
  string = get_first_string(STRINGS)
  
  while(string != null)
    if(is_superstring(superstring, string)
      return true;
    end
  end
  
  return false;
end


def process_superstrings(STRINGS, SUPERSTRINGS)
  superstring = get_first_string(SUPERSTRINGS)
  
  while(superstring != null) 
    if(check_string(superstring, STRINGS)
      print_string(superstring)
    end
    
    string = get_next_string(SUPERSTRINGS)
  end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment