human
Count of bitonic substrings from the given string | Function to find all the bitonic sub strings.
Pick starting po.
Iterate till length of the string.
Pick ending pofor string.
Substring from i to j is obtained.
Substrings of length 1.
Increase count.
For increasing sequence.
Check for strictly increasing.
Increase count.
Check for decreasing sequence.
Increase count.
Print the result.
Given string.
Function Call"
Solution in Python:
 ... What is a code to count of bitonic substrings from the given string and the other steps required?
assistant
#Here is code to count of bitonic substrings from the given string and the other steps required.
 def subString ( str , n ) :
	c = 0 ;
	for len in range ( 1 , n + 1 ) :
		for i in range ( 0 , n - len + 1 ) :
			j = i + len - 1 ;
			temp = str [ i ]
			f = 0 ;
			if ( j == i ) :
				c += 1
				continue ;
			k = i + 1 ;
			while ( k <= j and temp < str [ k ] ) :
				temp = str [ k ] ;
				k += 1 ;
				f = 2 ;
			if ( k > j ) :
				c += 1 ;
				f = 2 ;
			while ( k <= j and temp > str [ k ] and f != 2 ) :
				k += 1 ;
				f = 0 ;
			if ( k > j and f != 2 ) :
				c += 1 ;
				f = 0 ;
	print ( c )
str = " bade " ;
subString ( str , len ( str ) )