Synopsys Interview Question

implement string.size() in C++