More clarity on the order


Hello .

ans = [2, 0, 1]
Here, sorted reviews are ["cool_wifi_speed", "water_is_cool", "cold_ice_drink"]

what is the order for reviews that share the same number of target words. for example, why is “water_is_cool” ahead of “cold_ice_drink” ?

Thanks for the help in advance


Then their initial order in B is used to determine the new position. Since in B ‘water_is_cool’ is ahead of ‘cold_ice_drink’ (and both have same value of goodness), so in the ans ‘water_is_cool’ will come before ‘cold_ice_drink’