C
C#11mo ago
Mayonaize

❔ Removing dupes in a linked list

I need to make a function that gets a linked list, and returns that linked list with all sequences of 3 or more consecutive equal numbers be removed for example: 1,3,3,3,4,5,5,6,9,9,9,9 becomes 1,4,5,5,6
129 Replies
JakenVeina
JakenVeina11mo ago
$details
MODiX
MODiX11mo ago
When you ask a question, make sure you include as much detail as possible. Such as code, the issue you are facing, and what you expect the result to be. Upload code here https://paste.mod.gg/ (see $code for more information on how to paste your code)
Mayonaize
Mayonaize11mo ago
well i dont have any code written as i dont have an idea as to were to start sadly thats also my issue
JakenVeina
JakenVeina11mo ago
alright let's break down the problem
Mayonaize
Mayonaize11mo ago
I have a very vague idea but no more than that
JakenVeina
JakenVeina11mo ago
gotta start somewhere what is your vague idea?
Mayonaize
Mayonaize11mo ago
so
Mayonaize
Mayonaize11mo ago
first thing is
No description
Mayonaize
Mayonaize11mo ago
p1 being a pointer on first object p2 on the one after and inside that if clause i would put it into a new list hold on ill write it so its more clear
JakenVeina
JakenVeina11mo ago
so A) your plan is to build a new list, rather than trying to modify the existing one
Mayonaize
Mayonaize11mo ago
No description
Mayonaize
Mayonaize11mo ago
yeah thats what they want in the question, sorry i didnt specify
JakenVeina
JakenVeina11mo ago
great
Mayonaize
Mayonaize11mo ago
although it really doesnt matter since i can make a copy of the old list i have a function for that
JakenVeina
JakenVeina11mo ago
you're allowed to use the built-in LinkedList here, or you have to write your own?
Want results from more Discord servers?
Add your server