Solve Picking Number Problem on Hacker Rank Using C#
Given an array of integers, find the longest sub array where the absolute difference between any two elements is less than or equal to 1 .
a=[1,1,2,2,4,4,5,5,5];
There are two sub arrays meeting the criterion:[1,1,2,2] and .[4,4,5,5,5] The maximum length sub array has 5 elements.
If you want to solve this type of problem next time own their own then please watch this video till the end, you may solve this problem just copying the code but copying code is not perfect solution.
After watching this video if you still facing any challenges or issue please feel free to write to us on [email protected] or in comment section
We love to hear your query and we will back to you as soon as possible.
Happy Learning
Codes Evidence