in java question:
Linked list contains consecutive repeated int numbers asillustreded in example. Write a method shrink()what removesrepeated numbers and leave one copy for each sequence of repeatednumber.
L:6->6->6->6->5->5->5->10->10->10->10->5->5->5->5->3->null
Resultant List after shrink() method
L: 6->5->10->5->3->null
Answer