The first option, const int size() { return sz; } affects the return type, you can imagine it as something similar to:
using ConstInt = const int;
ConstInt size() { return sz; }
The second option int size() const { return sz; } means that the size() method does not (and cannot) modify the object.