hackerrank.com
Set Mutations
Problem link : https://www.hackerrank.com/challenges/py-set-mutations/problem?utm_campaign=challenge-recommendation&utm_medium=email&utm_source=24-hour-campaign&h_r=next-challenge&h_v=zen&h_r=next-challenge&h_v=zen&h_r=next-challenge&h_v=zen
Difficulty : Easy
Tip
- This problem is a bit difficult
- We can call a method with a name of it, please see getattr() for more detail
- getattr(s, c)(v) this is a key to resolve this problem
- c, *a = input().split(' ') c is fist item, *a is rest of all item
Solution