Program for two Sum
static Dictionary < int , Tuple < int , int > > twoSum ( int [ ] nums , int N ) { Dictionary < int , Tuple < int , int > > Map = new Dictionary < int , Tuple < int , int > > ( ) ; for ( int i = 0 ; i < N - 1 ; i ++ ) { for ( int j = i + 1 ; j < N ; j ++ ) { Map [ nums [ i ] + nums [ j ] ] = new Tuple < int , int > ( i , j ) ; } } return Map ; }