Problem

Return the middle element of an odd-length int array.

Examples

  • arrayMiddle([1, 2, 3]) -> 2
  • arrayMiddle([10, 20, 30, 40, 50]) -> 30
Compile and test (Ctrl+Enter)