My LeetCode grinding. Trying to do a problem a day.
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

problem.txt 312B

1234567891011121314
  1. Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.
  2. You may assume that the array is non-empty and the majority element always exist in the array.
  3. Example 1:
  4. Input: [3,2,3]
  5. Output: 3
  6. Example 2:
  7. Input: [2,2,1,1,1,2,2]
  8. Output: 2