This Question logic implemenation is easy , but as test case is very large so it is not able to pass in 2 seconds even after Meomizing the answer.↵
↵
Images : ↵
↵
https://imgur.com/agallery/anvdek1↵
↵
Images : ↵
↵
https://imgur.com/