human
I am working on the file "02_BinarySearch.ipynb".
The first task is:
Rotate String

Given a string and an offset, rotate string by offset. (rotate from left to right)
Given "abcdefg".
offset=0 => "abcdefg"
offset=1 => "gabcdef"
offset=2 => "fgabcde"
offset=3 => "efgabcd"
Can you write Python program for it?

What is a the Python program you requested?
assistant
#Here is the Python program you requested.

class Solution:
    # @param s: a list of char
    # @param offset: an integer 
    # @return: nothing
    def rotateString(self, s, offset):
        # write you code here
        def rev(s, start, end):
            for i in range((end - start) / 2 + 1):
                s[start+i], s[end-i] = s[end-i], s[start+i]

        if s is not None and len(s) > 0:
            n = len(s)
            offset %= n
            if 0 < offset < n-1:
                rev(s, 0, n - offset - 1)
                rev(s, n - offset, n - 1)
                rev(s, 0, n-1)
            elif offset == n-1:
                rev(s, 0 , n-1)