Question: I have setup a spark cluster using cassandra as data cluster in stand alone mode. On the other hand I'm using IntelliJ IDEA to write the driver code to be sent to the spark cluster to be executed by the workers.

What I would like to know if it is possible to execute code from intellij (in my local machine) into the remote cluster or I must create a .jar file and deploy it to the workers with the sopark-submit?.

I'm just looking for a confirmation because I'm having problems doing all setup and need to reduce possibilities.

Thanks in advance.

Answer: 
Imagine 

```
kangoroo(1,1,2,2)

```

So the first code would return *No* while the second does return *Yes*. You may implement the first condition into the second:

```
function kangaroo(x1, v1, x2, v2){
  if ((x1 - x2) % (v2 - v1) === 0 && !(x2 > x1 && v2 > v1)) {
    return "YES";
  }
 return " No";
}

```
The second condition in the first block of code is an **else** if. It will only run if the first if condition doesn't pass.

You can have input which matches both the if condition and the else if condition. That would result in the output being NO in the first case (the `if` matches and the `else if` is never run) but YES in your modified code (the former `else if` matches).