Given a two-dimensional array of integers, an index, and a string containing the letter "R" or "C:, return the sum of the elements in that row or column.

For example, if the input is {{1,2,3},{4,5,6}} with an index of 0 and string of "R", the result would be 6 (because 1 + 2 + 3 = 6). In the same case, if the string was "C" instead, the results would be 5 because 1 + 4 = 5. You may assume that both dimensions of the array have at least one element and that the given index exists for the row/column.