text: /**
   * Definition for singly-linked list.
   * struct ListNode {
   *     int val;
   *     ListNode *next;
   *     ListNode() : val(0), next(nullptr) {}
   *     ListNode(int x) : val(x), next(nullptr) {}
   *     ListNode(int x, ListNode *next) : val(x), next(next) {}
   * };
   */
  class Solution {
  public:
      
      ListNode* merge(ListNode* l1, ListNode* l2){
          if(l1 == NULL) return l2;
          if(l2 == NULL) return l1;
          
          ListNode* h;
          if(l1->val < l2->val){
              h = l1;
              h->next = merge(l1->next,l2);
          }else{
              h = l2;
              h->next = merge(l1,l2->next);
          }
          return h;
      }
      
      ListNode* mergeTwoLists(ListNode* l1, ListNode* l2) {
          ListNode* h = merge(l1,l2);
          return h;
      }
  };
  