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.
Just calculate three prices:
1. Total Price when gifts are bought at their original price without conversion
2. Total Price when gifts are bought at price of black (bc) and converated to white
3. Total Price when gifts are bought at price of white (wc) and converated to black
4. Just return the minimum cost
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Taum and B'day
You are viewing a single comment's thread. Return to all comments →
Oneliner
Just calculate three prices: 1. Total Price when gifts are bought at their original price without conversion 2. Total Price when gifts are bought at price of black (bc) and converated to white 3. Total Price when gifts are bought at price of white (wc) and converated to black 4. Just return the minimum cost