From 7f71c4c8d1c6daba609dafd28d14d0019df740b0 Mon Sep 17 00:00:00 2001 From: Rohan2015 Date: Sat, 3 Jun 2017 11:17:07 +0000 Subject: [PATCH] Done --- build.py | 17 +++++++++++++++++ build.pyc | Bin 0 -> 643 bytes tests/__init__.pyc | Bin 0 -> 163 bytes tests/test_is_rotation.pyc | Bin 0 -> 1053 bytes 4 files changed, 17 insertions(+) create mode 100644 build.pyc create mode 100644 tests/__init__.pyc create mode 100644 tests/test_is_rotation.pyc diff --git a/build.py b/build.py index e69de29..2000720 100644 --- a/build.py +++ b/build.py @@ -0,0 +1,17 @@ +def is_rotation(s1,s2): + if s1 == None: + return False + elif s1 == '' and len(s2) != 0: + return False + elif s1 == '' and s2 == '': + return True + elif len(s1) != len(s2): + return False + else: + for i in range(len(s1)): + if s1[i:] and s2[:i]: + return True + +s1 = 'foobarbaz' +s2 = 'barbazfoo' +is_rotation(s1,s2) diff --git a/build.pyc b/build.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4b76aa5741c28a35ded501921919f89da4756bb6 GIT binary patch literal 643 zcmb_YJx>Bb5PiEKieIrXMjNy;*Wke=cE*@!EUy3)B8f2zx4;S9;_Z^CfeL?xt(||* zKj6$_H1=LHZ|Cd1nYqH}*80a=blb)ESD^QT%pMaYz$?%uN1!c`NVFw1parzVLP8`3 zG=n0wb|nFm*)GZKJHgCr3?=d%IDsa|0vtzh5;K8?mmL;-=1)h=u!N$2nSbUo+r^V@H6LAy^?GDN345JC3f^ z$ZFyMBc1uuO+HT_dD~%@^(p- F#1}HEey9Kd literal 0 HcmV?d00001 diff --git a/tests/__init__.pyc b/tests/__init__.pyc new file mode 100644 index 0000000000000000000000000000000000000000..50f7aa874bf2b223726dffee780c783aa1792352 GIT binary patch literal 163 zcmZSn%*)lSZxETx00oRd+5w1*S%5?e14FO|NW@PANHCxg#XdkW{fzwFRQ;g*jKn-6 z14C2&@cg3e;)2BFRQ=@qlvMq+;*{c4-Ga)JjQl*^#Ny)2^t{~Eyb@hQ10(&C)Z&t2 h{rLFIyv&mLcs-yZ4xoWHx%nxjIjMFaYm0%H0RZ8=C20Tv literal 0 HcmV?d00001 diff --git a/tests/test_is_rotation.pyc b/tests/test_is_rotation.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0454a684c4fa4131b9a5795d8ba3f522899c23a5 GIT binary patch literal 1053 zcmcgqO>fjN5FID!*P@CR^}+@97$Gg$R&YZIQ5C6|J!DrZ?Ip^_4jY=-+t@i2mD6(L z|M1870r1AD*c=cyNaANtW;}lL#^I0s(YIuBRnWr|Vt$KZp93U5K{Zh$=vt7F0VzSH zAQ{qEqBYUgbwDzrS-get>L;F9VC8lJb7kFGZk2odU|iU&H7<9R(ZA2*=yw?Q5TJ;U z!Kp}&#Ocf@D>x>=;4{uJ?03N35px5hp57PGyVTDpasl0psC`L7hA(LIhs|9`F z9}(SSUqo_?)&V(>KC*Y99{nVmW~xLs0?Tvx2VL7iQHaqEb?}dfA&_tL_o|uA9 zv&{ABcO~xIETlHjw89f)9|G zy~F=pq