Fantasy Akhada Interview Question

Was given two leetcode medium level question. And few puzzles