Unable to run code

The class name is causing errors. Please tell me how to fix it. Also please tell me how to do this question. I have thought of using stack method to store nodes and pop them accordingly but can’t understand how to deal with the pointers

hey @Rishabh8488 code is fine
just a change Class Name Main Instead of LinkedList

By doing that I would have to change the object names in main method and where I have created LL