Kazi_Ziaul_Hassan's blog

By Kazi_Ziaul_Hassan, history, 2 months ago, In English,

Can anyone please suggest me the solution idea of the mentioned problem ? Here is the link below Problem link :

  • Vote: I like it
  • -2
  • Vote: I do not like it

2 months ago, # |
Rev. 3   Vote: I like it 0 Vote: I do not like it

Break the string on the basis on non-numeric characters. For each independent string, you need to find the number of substrings that are divisible by 3 which can be solved by using prefix sums.

Detailed Solution: https://softwareengineering.stackexchange.com/questions/268022/efficient-algorithm-to-count-number-of-substrings-divisible-by-3