From 9a9d23d3d8874662e5baba482d8499d672ff05e7 Mon Sep 17 00:00:00 2001 From: Egor Kostan <20955183+ikostan@users.noreply.github.com> Date: Mon, 30 Dec 2024 06:28:17 -0800 Subject: [PATCH] Update solution.py --- kyu_7/pointless_farmer/solution.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/kyu_7/pointless_farmer/solution.py b/kyu_7/pointless_farmer/solution.py index bca89d979da..5659555e0dc 100644 --- a/kyu_7/pointless_farmer/solution.py +++ b/kyu_7/pointless_farmer/solution.py @@ -21,9 +21,7 @@ def buy_or_sell(pairs: list, harvested_fruit: str) -> list[Any] | str: for pair in pairs: # First item in pairs is for selling, second is for buying. - if pair[0] == currently_holding == pair[-1]: - results.append('sell') - elif pair[-1] == currently_holding: + if pair[0] == currently_holding == pair[-1] or pair[-1] == currently_holding: results.append('sell') currently_holding = pair[0] elif pair[0] == currently_holding: