fork download
  1. ListNode* Solution::deleteDuplicates(ListNode* A) {
  2. ListNode *a = A;
  3. ListNode *b = A->next;
  4.  
  5. while(b != 0 && a != 0){
  6. if(a->val == b->val){
  7. a->next = b->next;
  8. delete b;
  9.  
  10. a = a->next;
  11. b = a->next;
  12. }
  13. }
  14.  
  15. return A;
  16. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:1: error: ‘ListNode’ does not name a type
 ListNode* Solution::deleteDuplicates(ListNode* A) {
 ^~~~~~~~
stdout
Standard output is empty