Refactor Global Variables Out of Functions

I feel like I understand what is going on with this problem but I am still lost on what I should do. Can someone please help me understand?

Both functions are using the bookList from the global scope and modifying it directly. The goal is to change both these behaviors.

  • Changing function to not use variables defined outside of function. Function is expected to accept additional parameter, which will be used to pass the list with books.
  • Changing function to not modify the input list, but to return new list. Created basing on the input list, but with added or removed element.