Doubt regarding class code

https://ide.codingblocks.com/s/50914

why we are adding str[0] to osf in base case , as it will be already included as ch1 ?

Hey, that is to add the last character of the string, when length of the string is 1 code will never reach to line:10 i.e. char ch1.

1 Like