Anyone think they know the answer? Post below!
The for loop has to go upto word.length/2
I am assuming this code is in C language from the looks of the syntax used.
so, it should be
for (int i = 0; i < word.length/2; i++)
not in touch with C language for a very long time, so I think that word.length is also incorrect.
there has to be a function to get the length of a null-terminated string of C. it should be
strlen(word) and not word.length
Also the return type for the function is missing.
Curious to know the programming language of the code.
Yes! You nailed it :)
We currently run into 2 out of bound exceptions
And its just some Pseudocode! Its not an actual language (although I based it off a mixture of C and Python :) )