Skip to content

2015-2: Longest Streak

Write a function that takes a numeric vector and returns the length of the longest streak of positive growth.

Examples:

     (your_function) 1 2 3 4 5 6 7 8 9 
8
     (your_function) 1 
0
     (your_function) 9 8 7 6 5 4
0
     (your_function) 1 5 3 4 2 6 7 8
3
your_function ←

Solutions

Video Thumbnail YouTube

Chat transcript Code on GitHub