num_str [terminology]
Terminology¶
Usage¶
- Use for a string that represents a number.
- It distinguishes the representation from an actual
intorfloat. - Prefer it over
numwhen the value's type is a string.
# ...
parts = sorted(map(str, nums), key=cmp_to_key(compare))
num_str = "".join(parts)
return "0" if num_str[0] == "0" else num_str
See 179. Largest Number.