mirror of
https://github.com/Manoj-HV30/dsa-competitive-programming.git
synced 2026-05-16 19:35:22 +00:00
Rename variable 'comp' to 'complement' for clarity
This commit is contained in:
@@ -2,7 +2,7 @@ public:
|
||||
vector<int> twoSum(vector<int>& nums, int target){
|
||||
unordered_map<int,int>hash;
|
||||
for(int i=0;i<nums.size();++i){
|
||||
int comp = target - nums[i];
|
||||
int complement = target - nums[i];
|
||||
if(hash.find(complement) != hash.end(){
|
||||
return {hash[complement],i};
|
||||
hash[nums[i]] = i;
|
||||
|
||||
Reference in New Issue
Block a user