Problem
Given an array, the task is to determine whether an array is a palindrome or not.
Examples
Example 1:
|
|
Example 2:
|
|
Solution
Method 1 - Iterative Using 2 Pointers
Initially left is at 0 and right at n-1. Then just compare till left is less than right.
Code
|
|