human
Give me a code to possible cuts of a number such that maximum parts are divisible by 3 and the other steps required given the following:
Possible cuts of a number such that maximum parts are divisible by 3 | Python3 program to find the maximum number of numbers divisible by 3 in a large number.
This will contain the count of the splits.
This will keep sum of all successive integers , when they are indivisible by 3.
This is the condition of finding a split.
Driver code"
How can the above be solved in Python?
assistant
#Here is code to possible cuts of a number such that maximum parts are divisible by 3 and the other steps required.
 def get_max_splits ( num_string ) :
	count = 0
	running_sum = 0
	for i in range ( len ( num_string ) ) :
		current_num = int ( num_string [ i ] )
		running_sum += current_num
		if current_num % 3 == 0 or ( running_sum != 0 and running_sum % 3 == 0 ) :
			count += 1
			running_sum = 0
	return count
print get_max_splits ( "12345" )