Remove duplicate li with class name

How to remove duplicate li or div from a page or section using jquery. Below is the code to do that

$('.your_page_or_section_class ul li').each(function() {
    var
    $this = $(this),
    cls_hide = '.' + $this.attr('class').split(' ')[0];              
    $(cls_hide).nextAll(cls_hide).remove();
});