We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
select w.id, wp.age, w.coins_needed, w.power from
wands w join wands_property wp on w.code=wp.code
where coins_needed = (select min(w1.coins_needed) from
wands w1 join wands_property wp1 on w1.code=wp1.code
where is_evil =0 and w1.power=w.power and wp1.age = wp.age)
order by power desc, age desc;
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Ollivander's Inventory
You are viewing a single comment's thread. Return to all comments →
select w.id, wp.age, w.coins_needed, w.power from wands w join wands_property wp on w.code=wp.code where coins_needed = (select min(w1.coins_needed) from wands w1 join wands_property wp1 on w1.code=wp1.code where is_evil =0 and w1.power=w.power and wp1.age = wp.age) order by power desc, age desc;