Priyansh: Solution 1 & 2 done in Python