Challenge Information

Title : Consecutive Sub-Sequence
Difficulty : Medium
Solutions : 6
Maximum Score : 100
Completed by You: No
Description :

An array of positive integers is given. Find the length of the longest sub-sequence such that elements in the sub-sequence are consecutive integers.

Write a function solve that have the following parameter(s):
1.) arr = array of integer

Example
Input:
There is an array of integers:
arr = [6,1,3,2]
Output:
The functuion will return:
3

Explanation
The consecutive numbers are [1, 2, 3], these form the longest consecutive sub-sequence.

Example
Input:
There is an array of integers:
arr = [ 10, 7, 4, 3, 1, 2]
Output:
The functuion will return:
4

Explanation
The consecutive numbers are [1, 2, 3, 4], these form the longest consecutive sub-sequence.

Constraints

Judocode