How Prefix & Suffix Arrays Unlock Hard Array Problems

Today I went through the leetcode famous two problems same question but different requirement for submisson.