Skip to content

Latest commit

 

History

History
79 lines (31 loc) · 1.42 KB

README_EN.md

File metadata and controls

79 lines (31 loc) · 1.42 KB

中文文档

Description

Given an array filled with letters and numbers, find the longest subarray with an equal number of letters and numbers.

Return the subarray. If there are more than one answer, return the one which has the smallest index of its left endpoint. If there is no answer, return an empty arrary.

Example 1:

Input: ["A","1","B","C","D","2","3","4","E","5","F","G","6","7","H","I","J","K","L","M"]



Output: ["A","1","B","C","D","2","3","4","E","5","F","G","6","7"]

Example 2:

Input: ["A","A"]



Output: []

Note:

  • array.length <= 100000

Solutions

Python3

Java

...