Question PSC-FUNC-0056
MediumWhat is the output of this pseudocode?
Function isPal(String s, Integer i, Integer j)
if (i >= j)
return true
end if
if (s[i] != s[j])
return false
end if
return isPal(s, i + 1, j - 1)
End Function
Print isPal("level", 0, 4), isPal("lever", 0, 4)
- A.
false true
- B.
true true
- C.
false false
- D.
true false
Sign up free to see the answer and a step-by-step explanation.