300iq loves numbers who are multiple of 300. One day he got a string consisted of numbers. He wants to know how many substrings in the string are multiples of 300 when considered as decimal integers. Note that leading and trailing zeros are allowed and the same substring appearing in different places can be counted multiple times.
300iq loves numbers who are multiple of 300. One day he got a string consisted of numbers. He wants to know how many substrings in the string are multiples of 300 when considered as decimal integers. Note that leading and trailing zeros are allowed (both in original string and substrings you chose) and the same substring appearing in different places can be counted multiple times.
(图片来源网络,侵删)