Company: Atlassian
Difficulty: easy
Confluence Ordinal Parity A text collaborative tool receives an array of strings. Each string is treated as a zero-indexed array of characters. Every character is a lowercase English letter, so its ASCII decimal value lies between 97 and 122. Those decimal values are called ordinal values and are written ord[c] , for instance ord[a] = 97 . Given an array of strings s = [s[0], s[1], ..., s[k-1]] and an integer m , the value of a string s[i] of length len(s[i]) is defined as value[i] = ord[s[i][0]]^m * ord[s[i][1]]^m * ... * ord[s[i][len(s[i])-1]]^m that is, the ordinal of every character of s[i] raised to the power m , all multiplied together. Perform this calculation on each string, sum the results, and determine whether that sum is EVEN or ODD . Worked example Consider s = ['abc', 'abcd'] with k = 2 strings and m = 2 . Written as a two-dimensional array of ordinals this is [[97, 98, 99], [97, 98, 99, 100]] . c ord pwr running value - --- ----- ------------- a 97 9409 9409 b 98 9604 90