diff --git a/build.py b/build.py index e69de29..2834a31 100644 --- a/build.py +++ b/build.py @@ -0,0 +1,20 @@ +def is_rotation(src,dest): + """ here a string s1 is a rotation of another string s2, + by calling (only once) a function is_rotation """ + + if(src == None or dest == None): + return False + elif(src == "" and dest == ""): + return True + elif(src == "" and dest != ""): + return False + elif(src != "" and dest == ""): + return False + else: + if(len(src) != len(dest)): + return False + + for i in range(len(src)): + if dest.startswith(src[i:]) and dest.endswith(src[:i]): + return True + return False diff --git a/build.pyc b/build.pyc new file mode 100644 index 0000000..7d83b83 Binary files /dev/null and b/build.pyc differ diff --git a/tests/__init__.pyc b/tests/__init__.pyc new file mode 100644 index 0000000..3083b23 Binary files /dev/null and b/tests/__init__.pyc differ diff --git a/tests/test_is_rotation.pyc b/tests/test_is_rotation.pyc new file mode 100644 index 0000000..16ee8ef Binary files /dev/null and b/tests/test_is_rotation.pyc differ