Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update getSecondHighestPriceByBrand.java #10

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Oct 4, 2024

  1. Update getSecondHighestPriceByBrand.java

    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 <99873259+burrasaiteja21@users.noreply.github.com>
    burrasaiteja21 authored Oct 4, 2024
    Configuration menu
    Copy the full SHA
    dd0577e View commit details
    Browse the repository at this point in the history