Write a function that does the following for the given values: add, subtract, divide and multiply. These are simply referred to as the basic arithmetic operations. The variables have to be defined, but in this challenge they will be defined for you. All you have to do is check the variables, do some string to integer conversions, use some if conditions, and apply the arithmetic operation.
operation("1", "2", "add" ) ➞ 3
operation("4", "5", "subtract") ➞ -1
operation("6", "3", "divide") ➞ 2ArithmeticException, then return Integer.MIN_VALUE (e.g. division by zero).