Question 6

You are given a double linked list and an array of pointers to elements in this list (no assumptions can be made on the array – number of pointers, order and duplicates allowed).
Return the number of sequences of elements (groups of consecutive elements), pointed by the array.
For example, if this is the array (number relates to index in the list, not the actual pointer value): 9,1,3,7,8,5,2.
Then output is 3, representing these sequences: [1,2,3], [5], [7,8,9]

KodNest Training New Batch is starting on 15th July 2020Check Now

New Report

Close