Company: DevRev
Difficulty: medium
Palindromic Array Transformation Problem Description An array is called palindromic if it remains the same after reversing the order of its elements. You have an array of strings arr . For each i , arr[i] consists of at least two characters. For each pair of consecutive elements arr[i] and arr[i + 1] , you can: Move the rightmost character of arr[i] to the leftmost position in arr[i + 1] . For instance, if arr[i] = "abc" and arr[i+1] = "def" , they will become arr[i] = "ab" and arr[i+1] = "cdef" . This operation can be applied only once to any pair of consecutive elements. Move the leftmost character of arr[i + 1] to the rightmost position in arr[i] . For instance, if arr[i] = "abc" and arr[i+1] = "def" , they will become arr[i] = "abcd" and arr[i+1] = "ef" . Again, this operation can be applied only once to any pair of consecutive elements. Do nothing to the pair of consecutive elements. Is it possible to obtain a palindromic array from arr by performing these operations? Examples Exa