import csv


def save_tasks_to_csv(tasks_list, filename):
        """
        param: tasks_list - The list of the tasks stored as dictionaries
        param: filename (str) - A string that ends with '.csv' which represents
                the name of the file to which to save the tasks. This file will
                be created if it is not present, otherwise, it will be overwritten.
        The function ensures that the last 4 characters of the filename are '.csv'.
        The function requires the `import csv`.
        The function will use the `with` statement to open the file `filename`.
        After creating a csv writer object, the function uses a `for` loop
        to loop over every task in the list and creates a new list
        containing only strings - this list is saved into the file by the csv writer
        object. The order of the elements in the list is:
        * `name` field of the task dictionary
        * `info` field of the task dictionary
        * `priority` field of the task as a string
        (i.e, "5" or "3", NOT "Lowest" or "Medium")
        * `duedate` field of the task as written as string
        (i.e, "06/06/2022", NOT "June 6, 2022")
        * `done` field of the task dictionary
        returns:
        -1 if the last 4 characters in `filename` are not '.csv'
        None if we are able to successfully write into `filename`
        """
        if filename[-4:] != '.csv':
                return -1
        with open(filename, 'w') as csvfile:
                writer = csv.writer(csvfile)
                for task in tasks_list:
                        writer.writerow([task['name'], task['info'], task['priority'], task['duedate'], task['done']])
        return None