Given the head of a singly linked list and a target integer value, return true if the value exists in the list, otherwise return false.
Traverse the list and check each node's value against the target.
Input: Head of a singly linked list and an integer target.
Output: Boolean true if target found, false otherwise.
Input: [1,2,3,4,5], 3
Output: true
Explanation: Traverse: 1≠3, 2≠3, 3=3 → found. Return true.Input: [1,2,3,4,5], 6
Output: false
Explanation: Traverse all 5 nodes — none equals 6. Return false.Input: [7], 7
Output: true
Explanation: Single node, value matches target. Return true.1 <= number of nodes <= 10^5-10^9 <= Node.val <= 10^9-10^9 <= target <= 10^9