전체 글 359

AlgoExpert Remove Duplicates from LinkedList

import java.util.*; class Program { // This is an input class. Do not edit. public static class LinkedList { public int value; public LinkedList next; public LinkedList(int value) { this.value = value; this.next = null; } } public LinkedList removeDuplicatesFromLinkedList(LinkedList linkedList) { LinkedList root = linkedList; while(linkedList.next != null){ if (linkedList.value == linkedList.nex..