Q47.Consider the procedure below. If `C = [3, 4, 1, 9, 5, 3, 1, 9]` and `B = doSomething(C)`, what will be the value of `first(B)`?
```
Procedure doSomething(A)
outList = [last(A)]
foreach X in A {
if(X != last(outList)) {
outList = [X] ++ outList
}
}
return(outList)
End DoSomething
```
Save
Check
Details
Q47
2 Apr 2023
Q47.Consider the procedure below. If `C = [3, 4, 1, 9, 5, 3, 1, 9]` and `B = doSomething(C)`, what will be the value of `first(B)`?
```
Procedure doSomething(A)
outList = [last(A)]
foreach X in A {
if(X != last(outList)) {
outList = [X] ++ outList
}
}
return(outList)
End DoSomething
```