Get Lowest Free Problem Code: SALE | Code Chef Solution | Python3

Publicado el: 23 febrero 2022
en el canal de: Python Coder
490
2

Chef goes to the supermarket to buy some items. Luckily there's a sale going on under which Chef gets the following offer:

If Chef buys 3 items then he gets the item (out of those 3 items) having the lowest price as free.
For e.g. if Chef bought 3 items with the cost 6, 2 and 4, then he would get the item with cost 2 as free. So he would only have to pay the cost of the other two items which will be 6+4=10.

Chef buys 3 items having prices A, B and C respectively. What is the amount of money Chef needs to pay?

Input Format
The first line will contain an integer T - number of test cases. Then the test cases follow.
The first and only line of each test case contains three integers A,B,C - the prices of the items bought by Chef.
Output Format
For each test case, output the price paid by Chef.

Sample Input 1
3
6 2 4
3 3 3
8 4 4
Sample Output 1
10
6
12
Explanation
Test case-1: Explained in the problem statement.

Test case-2: Since all the three items have the same price, Chef will get one of them free and will have to pay the cost of the other two items which will be 3+3=6.

Test case-3: Chef will get one of the items having price 4 as free and will have to pay the cost of the other two items which will be 8+4=12.


En esta página del sitio puede ver el video en línea Get Lowest Free Problem Code: SALE | Code Chef Solution | Python3 de Duración hora minuto segunda en buena calidad , que subió el usuario Python Coder 23 febrero 2022, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 490 veces y le gustó 2 a los espectadores. Disfruta viendo!