संदेश

सितंबर, 2022 की पोस्ट दिखाई जा रही हैं
चित्र
Hello World! Hello World! Using this project This is the Glitch Hello Website project. You can use it to build your own site. Check out the code in the editor and open the TODO for next steps!

Two Sum Problem

class Solution { public:     vector < int > twoSum ( vector < int > & nums , int target ) {         vector <int> vec;         unordered_map <int , int> map;         for ( int i = 0 ; i < nums . size (); i ++ )         {             if (map. find ( target - nums [i]) != map. end ())             {                 vec. push_back (map[ target - nums [i]]);                 vec. push_back (i);                 return vec;             }             map[ nums [i]] = i;         }         return vec;     } };
First Name Last Name Email Company City State/Province