Skip to content

Conversation

burrasaiteja21
Copy link

Fixed the second highest price logic:

Before, it only returned the first matching brand, but now it finds all matching footwear, sorts them by price, and returns the second highest one. Added sorting:

I used a list to collect matching footwear, then sorted them by price from highest to lowest to get the correct result. These changes ensure that the program works as expected, especially when finding the second highest priced footwear for a brand.

Fixed the second highest price logic:

Before, it only returned the first matching brand, but now it finds all matching footwear, sorts them by price, and returns the second highest one.
Added sorting:

I used a list to collect matching footwear, then sorted them by price from highest to lowest to get the correct result.
These changes ensure that the program works as expected, especially when finding the second highest priced footwear for a brand.

Signed-off-by: Burra Saiteja <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant