Company: Akamai SDE off-campus_16may

Difficulty: medium

Problem Statement

Palindromic Strings A palindrome reads identically forwards and backwards — mom , a and radar are palindromes. You are given an array of n strings arr[0], arr[1], ..., arr[n-1] , each made only of lowercase English letters. In a single operation you pick two distinct strings arr[x] and arr[y] ( x != y ), pick one position in each, and swap the two letters standing there. You may perform as many operations as you like, in any order. Note that both letters must come from two different strings — an operation that moves a letter inside one string is not allowed. Report the greatest number of strings that can be palindromes at the same time after you stop. Input Format The first line contains a single integer n , the number of strings. Each of the next n lines contains one string arr[i] . Output Format Print a single integer — the maximum number of palindromic strings that can be obtained. Constraints 1 <= n <= 1000 1 <= length(arr[i]) <= 1000 The total length of all strings, le

More Akamai SDE off-campus_16may OA questionsInterview experiences