how to find sum of two nums
#include<stdio.h>
int main() {
int a, b, sum;
printf("\nEnter two no: ");
scanf("%d %d", &a, &b);
sum = a + b;
printf("Sum : %d", sum);
return(0);
how to find sum of two nums
#include<stdio.h>
int main() {
int a, b, sum;
printf("\nEnter two no: ");
scanf("%d %d", &a, &b);
sum = a + b;
printf("Sum : %d", sum);
return(0);
two sum problem
vector<int> twoSum(vector<int>& nums, int target) {
int front = 0, rear = nums.size() - 1;
sort(nums.begin(), nums.end());
while(front < rear) {
int sum = nums[front] + nums[rear];
if (sum == target)
break;
else if (sum > target)
rear--;
else
front++;
}
return {front, rear};
};
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us