Sum Excluding before and after (Problem 31) - InfyTQ Solution in Python
Sum Excluding before and after (Problem 31)
InfyTQ Solution in Python
PROBLEM STATEMENT
Given a list of integers and a number. Write a python function to find and return the sum of the elements of the list.
Note: Don't add the given number and also the numbers present before and after the given number in the list .
Note: Don't add the given number and also the numbers present before and after the given number in the list .
Sample Input | Expected Output |
---|---|
list=[1,2,3,4], number=2 | 4 |
list=[1,2,2,3,5,4,2,2,1,2],number=2 | 5 |
list=[1,7,3,4,1,7,10,5],number=7 | 9 |
list=[1,2,1,2],number=2 | 0 |
SOLUTION
SHARE
If you find this useful, please share with your friends and Community.
CODE TOGETHER..GROW TOGETHER.
CODE TOGETHER..GROW TOGETHER.
Newer Posts
Newer Posts
Older Posts
Older Posts
Comments