I actually used splitString.length at first during the interview, but I wasn't getting the right result-- I came up short. Then I realized I needed to use str.length instead to get the desired result, and it was what the interviewer was looking for.
Thank you for your well-thought-out, detailed comment! I will keep those pointers in mind during the next technical interview.
I actually used
splitString.length
at first during the interview, but I wasn't getting the right result-- I came up short. Then I realized I needed to usestr.length
instead to get the desired result, and it was what the interviewer was looking for.Thank you for your well-thought-out, detailed comment! I will keep those pointers in mind during the next technical interview.
Ah well I'd have made that mistake as well then :) Fair enough!