Q3Numerical5 Marks31 Aug 2025
What will the value of S be at the end of the execution of the following pseudocode?
```
l1 = [3, -2, 2]
l2 = [6, 1, 1]
S = doSomething(l1, l2)
Procedure doSomething(X, Y)
if(length(X) != length(Y)){
return(0)
}
if(length(X) == 1 and length(Y) == 1){
return(first(X) * first(Y))
}
return(first(X) * last(Y) + doSomething(rest(X), init(Y)))
End doSomething
```
Press Enter to check.