Problem

Return true if the last elements of two non-empty int arrays are equal.

Examples

  • sameLast([2, 4, 9], [1, 9]) -> true
  • sameLast([2, 4, 9], [1, 8, 2]) -> false
  • sameLast([5], [5]) -> true
Compile and test (Ctrl+Enter)