LearnPy Hub
← Lists problems
Hard

Longest Rising Run

Read integers and find the longest run of neighbours that strictly increase. Print its length and the run itself; if two runs tie, print the first.

Input

Integers separated by spaces.

Output

Two lines.

Sample 1

Input
1 3 5 4 7 8 9 2
Output
4
4 7 8 9

Sample 2

Input
5 4 3
Output
1
5
solution.py
Output appears here
Longest Rising Run · Python practice problem · LearnPy Hub