Tag: array algorithm
Given a list of integers nums, a string op representing either “+”, “-“, “/”, or “*”, and an integer val, perform the operation on every number in nums with …
Given a list of integers nums, swap each consecutive even indexes with each other, and swap each consecutive odd indexes with each other. Example 1 Input nums = Output …
Given an array A of integers, return true if and only if it is a valid mountain array. Recall that A is a mountain array if and only if: …
Given an array of integers of size N. The array should originally store numbers from 1 to N, however, during transmission, one of the number is duplicated to another …
Given an array of integers – find out the maximum product of the tree numbers in the array. For example, output: and , output 24. We can easily write …