CPP- Divide Subarrays, Pigeonhole Problem

May you please explain how the instructor has said in brute force approach there are nC2 anrrays and n elements so time complexity is n3 I am not clear with it

also please explain his second approach