Skip to content

Solution for Q_04_24 is wrong #53

Description

@dash-anurag

The solution for Q_04_25 is incorrect. The code gives wrong output for:
first City = Chicago
second City = Los Angeles
third City = Atlanta

Correct Logic:

        if ( first.compareTo(second) > 0) {
            temp = first;
            first = second;
            second = temp;
        }

        if( first.compareTo(third) > 0) {
            temp = first;
            first = third;
            third = temp;
        }

        if( second.compareTo(third) > 0 ) {
            temp = second;
            second = third;
            third = temp;
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions