Driver program
public static void main ( String args [ ] ) { int k , n ; char arr1 [ ] = new char [ ] { ' P ' , ' T ' , ' T ' , ' P ' , ' T ' } ; k = 2 ; n = arr1 . length ; System . out . println ( " Maximum ▁ thieves ▁ caught : ▁ " + policeThief ( arr1 , n , k ) ) ; char arr2 [ ] = new char [ ] { ' T ' , ' T ' , ' P ' , ' P ' , ' T ' , ' P ' } ; k = 2 ; n = arr2 . length ; System . out . println ( " Maximum ▁ thieves ▁ caught : ▁ " + policeThief ( arr2 , n , k ) ) ; char arr3 [ ] = new char [ ] { ' P ' , ' T ' , ' P ' , ' T ' , ' T ' , ' P ' } ; k = 3 ; n = arr3 . length ; System . out . println ( " Maximum ▁ thieves ▁ caught : ▁ " + policeThief ( arr3 , n , k ) ) ; } }