you give head link list contain unique integer value integer array nums subset link list valuesreturn number connect component num value connect appear consecutively link list example 1input head 0123 num 013output 2explanation 0 1 connect 0 1 3 connect componentsExample 2input head 01234 num 0314output 2explanation 0 1 connect 3 4 connect 0 1 3 4 connect component ConstraintsThe number node link list n1 n 1040 Nodeval nAll value Nodeval unique1 numslength n0 numsi nAll value num unique