Minimum number of bombs | function to print where to shoot ; no . of bombs required ; bomb all the even positions ; bomb all the odd positions ; bomb all the even positions again ; Driver Code
< ? php function p_rint ( $ n ) { echo floor ( $ n + $ n / 2 ) , " STRNEWLINE " ; for ( $ i = 2 ; $ i <= $ n ; $ i += 2 ) echo $ i , " ▁ " ; for ( $ i = 1 ; $ i <= $ n ; $ i += 2 ) echo $ i , " ▁ " ; for ( $ i = 2 ; $ i <= $ n ; $ i += 2 ) echo $ i , " ▁ " ; } $ n = 3 ; p_rint ( $ n ) ; ? >