I've been trying to understand recursion/recursivity in programming languages and I've chosen to work with python, since it's the language I understand the most. I've tried resolving the following problem -
Given three different lists of elements, find all the possible patterns that a certain person has followed during his shopping day.
Lists
purchases = [[money_spent, time0], [money_spent, time1], [money_spent, time3]]
time_between_shops = [[time_to_self, time_to_shop2, time_to_shop3, time_to_shop4],
[time_to_shop1, time_to_self, time_to_shop3, time_to_shop4],
[time_to_shop1, time_to_shop2, time_to_self, time_to_shop4],
[time_to_shop1, time_to_shop2, time_to_shop3, time_to_self]]
list_of_products = [["shop1", {"product1": price_of_product1, "product2": price_of_product2}],
["shop2", {"product3": price_of_product3, "product4": price_of_product4, "product5": price_of_product5}],
["shop3", {"product6": price_of_product6}],
["shop4", {"product7": price_of_product7}]]
In those lists purchases are ordered by their time (earliest to latest purchase) and shops have the same indexes in the list_of_products as in time_between_shops. Time between shops can be the same, but the time it takes to go from shop A to shop B can be different from the time it takes to go from shop B to shop A. The given time is in minutes where 0 is 0:00 and 1439 is 23:59.
Given that information, I know how to approach this problem the regular way, however I need to use recursive methods to obtain all the possibilities. I've read up on recursive methods, so I know what they represent, and when I see one I can understand what it does and how it works, but when it comes to creating recursive methods on my own, I get lost since I always go back to regular methods.
So how should I approach this problem in order to resolve it using recursion instead of the regular methods?