Driver program
int main ( ) { int k , n ; char arr1 [ ] = { ' P ' , ' T ' , ' T ' , ' P ' , ' T ' } ; k = 2 ; n = sizeof ( arr1 ) / sizeof ( arr1 [ 0 ] ) ; cout << " Maximum ▁ thieves ▁ caught : ▁ " << policeThief ( arr1 , n , k ) << endl ; char arr2 [ ] = { ' T ' , ' T ' , ' P ' , ' P ' , ' T ' , ' P ' } ; k = 2 ; n = sizeof ( arr2 ) / sizeof ( arr2 [ 0 ] ) ; cout << " Maximum ▁ thieves ▁ caught : ▁ " << policeThief ( arr2 , n , k ) << endl ; char arr3 [ ] = { ' P ' , ' T ' , ' P ' , ' T ' , ' T ' , ' P ' } ; k = 3 ; n = sizeof ( arr3 ) / sizeof ( arr3 [ 0 ] ) ; cout << " Maximum ▁ thieves ▁ caught : ▁ " << policeThief ( arr3 , n , k ) << endl ; return 0 ; }