amrs-tech / Hacktoberfest-Beginner-level

A beginner-friendly repository to help first-time-contributors in the open source.
MIT License
45 stars 185 forks source link

Added a Cpp program (Check if stack elements are pairwise consecutive) #282

Open Mrinalini99 opened 4 years ago

Mrinalini99 commented 4 years ago

I added a Cpp program to check if stack elements are pairwise consecutive.

For Example :- Input : stack = [4, 5, -2, -3, 11, 10, 5, 6, 20] Output : Yes Explanation - Each of the pairs (4, 5), (-2, -3), (11, 10) and (5, 6) consists of consecutive numbers