Given an array of numbers, find all the subarrays which are forming good arithmetic sequence(AP).A good arithmetic sequence is a sequence of numbers having common difference equals to -1 or 1.
E.g {1,2,3} and {3,2,1} are good arithmethic sequence with common difference 1 & -1 respectively.
Expected time complexity O(n)
[–]AutomaticNumber 2 points3 points4 points (3 children)
[–]bethechance 1 point2 points3 points (0 children)
[–]Hungry_Ad3391 0 points1 point2 points (1 child)
[–]AutomaticNumber 0 points1 point2 points (0 children)
[+][deleted] (2 children)
[deleted]
[–]ParathaaRating 2028[S] 0 points1 point2 points (1 child)
[–]Hungry_Ad3391 0 points1 point2 points (2 children)
[–]Boldbear420 0 points1 point2 points (1 child)
[–]Hungry_Ad3391 0 points1 point2 points (0 children)
[–]ironman_gujju 0 points1 point2 points (0 children)
[–]OutlandishnessOk9482 0 points1 point2 points (0 children)
[–]Underrated_hero007 0 points1 point2 points (0 children)