The TransCompilator

Solved LeetCode program · 203 of 1,000

#0234 · Palindrome Linked List

Easy Stack chunk-05.md

Original English source

The numbers is a list of 1, 2, 2, and 1. The left is 0. The right is the last position of numbers. The answer is 1.
Repeat while left is less than right.
If item left of numbers is not item right of numbers, set answer to 0. Add 1 to left. Decrease right by 1.

If answer is 1, show true, otherwise show false.

Open in Playground Browse all 1,000 problems

Expected stdout

true