##
Number of substrings divisible by 6 in a string of integers
April 13, 2017

Given a string consisting of integers 0 to 9. The task is to count the number of substrings which when convert into integer are divisible by 6. Substring does not contain leading zeroes. Examples: Input : s = “606”. Output : 5 Substrings “6”, “0”, “6”, “60”, “606” are divisible by 6. Input : s… Read More »