3201. Find the Maximum Length of Valid Subsequence I (Leetcode Medium)

preview_player
Показать описание
Larry solves and analyzes this Leetcode problem as both an interviewer and an interviewee. This is a live recording of a real engineer solving a problem live - no cuts or edits!

#leetcode #coding #programming
Рекомендации по теме
Комментарии
Автор

Were you able to make your thing longer?

Algorithmist
Автор

No i haven't seen anything like this before
first mod every element by 2
there only 4 possible combinations:
00 -> n - sum(nums)
01 -> count
10 -> count
11 -> sum(nums)
return max of these 4

cursed_nerd