Amazon Interview Question

String to Integer without Libraries