As I didn't find any blog regarding this. Let's discuss our approach here :)
Question A) Simple but tricky.
Question B) I used binary search on multiset to find the largest number <=2*ri.
Question C) My logic was to find the minimum index I (0<= I <=n) such that both sides should be a palindrome.
Question D) I thought to use some brute force and don't know why it passed partially.
Your approach will be welcome in the comment box. Thank you
POV: Why are you guys downvoting this blog? Why there is so much unnecessary hate? This blog helps people to get logic from their superior and some random guys just downvoting this blog. illogical