Chitresh-code / DSA_Worksheet

Worksheet posting DSA problems every day for GNIOT Students to solve and create PR's.
MIT License
17 stars 34 forks source link

Triplet Sum in Array #75

Open DebidYadav opened 10 months ago

DebidYadav commented 10 months ago

❗Write Code in Only One Language (CPP, C, Java, Python)

Give File Name : triplet_sum βœ… In respective language folder

πŸ“‘ DESCRIPTION

Triplet Sum in Array

Difficulty

Problem Statement: Given an array arr of size n and an integer X. Find if there's a triplet in the array which sums up to the given integer X.

Input Format:

An integer n which is size of the array and a space separated number x as the sum.
An array of size n.

Output Format:

An integer 1 or true and 0 for false.

Sample Input 1

n = 5, X = 10
arr[] = [1 2 4 3 6]

Sample Output 1

1

Sample Input 2

n = 6, X = 13
arr[] = [1 4 45 6 10 8]

Sample Output 2

1

Constraints

1 ≀ n ≀ 103
1 ≀ A[i] ≀ 105

https://practice.geeksforgeeks.org/problems/triplet-sum-in-array-1587115621/1

DebidYadav commented 10 months ago

Please assign it to me.

akshathmangudi commented 10 months ago

I would like to complete this. Can this be assigned to me?

akshathmangudi commented 10 months ago

@Chitresh-code, I've created a PR. Please review it and mark it under 'hacktoberfest-accepted'

yashashwini16 commented 10 months ago

hey @Chitresh-code can you assign this to me , I like to code in python