Panalphabetic window in a string | Return if given string contain panalphabetic window . ; traversing the string ; if character of string is equal to ch , increment ch . ; if all characters are found , return true . ; Driver Code
< ? php function isPanalphabeticWindow ( $ s , $ n ) { $ ch = ' a ' ; for ( $ i = 0 ; $ i < $ n ; $ i ++ ) { if ( $ s [ $ i ] == $ ch ) $ ch ++ ; if ( $ ch == ' z ' ) return true ; } return false ; } $ s = " abujm ▁ zvcd ▁ acefc ▁ deghf ▁ gijkle " . " ▁ m ▁ n ▁ o ▁ p ▁ pafqrstuvwxyzfap " ; $ n = strlen ( $ s ) ; if ( isPanalphabeticWindow ( $ s , $ n ) ) echo ( " YES " ) ; else echo ( " NO " ) ; ? >