func IsPalindrome2(l *list.List) bool {
	fast, slow := l.Front(), l.Front()
	stack := stack.New()
	for ; !l.IsConsumed(fast) && !l.IsConsumed(fast.Next); fast = fast.Next.Next {
		stack.Push(slow.Value)
		slow = slow.Next
	}
	if l.IsConsumed(fast.Next) {
		slow = slow.Next
	}
	for ; !l.IsConsumed(slow); slow = slow.Next {
		if slow.Value != stack.Pop() {
			return false
		}
	}
	return true
}
// IsPalindrome2 checks if a list l is a palindrome

IsPalindrome2 checks if a list l is a palindrome
// IsPalindrome2 checks if a list l is a palindrome
func IsPalindrome2(l *list.List) bool {
	fast, slow := l.Front(), l.Front()
	stack := stack.New()
	for ; !l.IsConsumed(fast) && !l.IsConsumed(fast.Next); fast = fast.Next.Next {
		stack.Push(slow.Value)
		slow = slow.Next
	}
	if l.IsConsumed(fast.Next) {
		slow = slow.Next
	}
	for ; !l.IsConsumed(slow); slow = slow.Next {
		if slow.Value != stack.Pop() {
			return false
		}
	}
	return true
}
func IsPalindrome2 ( l * list . List ) bool { fast , slow := l . Front ( ) , l . Front ( ) stack := stack . New ( ) for ; ! l . IsConsumed ( fast ) && ! l . IsConsumed ( fast . Next ) ; fast = fast . Next . Next { stack . Push ( slow . Value ) slow = slow . Next } if l . IsConsumed ( fast . Next ) { slow = slow . Next } for ; ! l . IsConsumed ( slow ) ; slow = slow . Next { if slow . Value != stack . Pop ( ) { return false } } return true }
IsPalindrome2 checks if a list l is a palindrome
IsPalindrome2 checks if a list l is a palindrome