text: C # implementation of the approach
code: using System ; using System . Collections . Generic ; class GFG { static int MAX = 100001 ; static int ROW = 10 ; static int COl = 3 ; static List < int > [ ] indices = new List < int > [ MAX ] ;