Monday, 20 April 2020

Rotate String | Practice Problem on String | Python | Castor Classes

Prerequisites:

Strings in Python | Python | Castor Classes


Strings in Python | Part 2 | Castor Classes


Code:

class Solution:

    def rotateString(self, A: str, B: str) -> bool:

        if(len(A)!=len(B)):

            return False;

        else:

            A=A+A;

            if( B in A):

                return True;

            else:

                 return False;

0 Comments:

Post a comment

Popular Posts

Categories

Android (21) AngularJS (1) Assembly Language (2) Books (10) C (75) C# (4) C++ (81) Course (1) Data Strucures (4) Downloads (1) Engineering (13) flutter (1) FPL (17) Hadoop (1) HTML&CSS (38) IS (25) Java (87) Leet Code (4) PHP (20) Projects (1) Python (218) R (69) Selenium Webdriver (2) Software (14) SQL (27)