Mphasis interview question

Convert string to Integer without java API Find how many times each charater is in the string