Skip to content

Instantly share code, notes, and snippets.

@jerrypy
Created November 5, 2017 14:23
Show Gist options
  • Save jerrypy/febf37cf4b216ef631721bedc3cbf707 to your computer and use it in GitHub Desktop.
Save jerrypy/febf37cf4b216ef631721bedc3cbf707 to your computer and use it in GitHub Desktop.
MIT 6.00 Assignments solution
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from ps3b import subStringMatchExact
from ps3c import subStringMatchOneSub
def subStringMatchExactlyOneSub(target, key):
t1 = subStringMatchExact(target, key)
t2 = subStringMatchOneSub(target, key)
ans = ()
for i in t2:
if i not in t1:
ans += (i, )
return ans
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment