Close Numbers (Problem 13) - InfyTQ Solution in Python

"Close" Numbers (Problem 13)

InfyTQ Solution in Python


Photo by Magda Ehlers from Pexels


PROBLEM STATEMENT

Write a python function which accepts three numbers and returns True if

a. one of the three numbers is "close" to any one of the other numbers (differing from a number by at most 1), and

b.Number that is left out is "far", differing from both other values by 2 or more.

Return false if the above mentioned conditions are not satisfied.


Sample Input Expected Output
4,1,3 True
5,6,7 False



SOLUTION
SHARE If you find this useful, please share with your friends and Community.
CODE TOGETHER..GROW TOGETHER.
Newer Posts Newer Posts Older Posts Older Posts

More posts

Comments

Post a Comment

Sponsored Content