Leetcode 2295: Problem Discussion

Правка en2, от introart, 2022-06-05 09:23:57

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?

Теги leetcode, array, hashmap, need help

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский introart 2022-06-05 09:23:57 3 Tiny change: ' in nums` was not nece' -> ' in nums` is not nece'
en1 Английский introart 2022-06-05 09:21:43 494 Initial revision (published)