def rotate(pattern):
    """Rotate pattern by 90 angles to the right."""
    rotated = []
    for row_no, row in enumerate(pattern):
        rotated.append('')
        for col_no, char in enumerate(row):
            rotated[row_no] += pattern[len(pattern) - 1 - col_no][row_no]
    return rotated