Medifast interview question

Questions on string manipulation Java