bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths
MediumArrays & HashingLC 324

Wiggle Sort II

Given an integer array nums, reorder it such that nums[0] nums[2] < nums[3].... You may assume the input array always has a valid answer.

Asked at 5 companies
AirbnbAkuna CapitalFacebook
Hints
  • 1.Think about which data structure fits best
  • 2.Consider the time complexity of your approach
  • 3.Look for patterns in the constraints
LeetCode