Блог пользователя introart

Автор introart, история, 23 месяца назад, По-английски

This problem came in today's Leetcode Weekly contest 296.

The solution to this problem is pretty straightforward.
But my question is:
how can I solve the problem if the condition: operations[i][1] does not exist in nums is not necessarily true.

As an example

Input: nums = [1,2,3,4], operations = [[2,3],[3,1],[1,4]]
Output: [4,4,4,4]

Can anyone please help me?

  • Проголосовать: нравится
  • -10
  • Проголосовать: не нравится

»
23 месяца назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

lol i misread and ended up solving this version in the contest with dsu