Amazon Interview Question

Write method that converts a string to a number