C # implementation of the approach
using System ; using System . Collections . Generic ; class GFG { class pair { public char first ; public int second ; public pair ( char first , int second ) { this . first = first ; this . second = second ; } }