add import java.util.*
and created ListNode & TreeNode class