We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
this is my solution , but test case 5 got wrong,I download the test case file,but the result is right,I dont know why
{-# LANGUAGE OverloadedStrings #-}moduleMainwhereimportControl.MonadimportqualifiedData.ByteStringasBimportqualifiedData.ByteString.Char8asS8importDebug.Traceissubxy|S8.nullx=False|S8.nully=True|S8.headx==S8.heady=ifflagthenTrueelseissub(S8.dropsameLengx)y|otherwise=issubxsywherexs=S8.tailxys=S8.tailyneed=S8.lengthyszips=S8.zipxysameLeng=1+length(takeWhile(\e->fste==snde)zips)flag=ys==S8.takeneedxsmain=doline<-Prelude.getLineletnum=readlinearr<-forM[1..num]$\_->doa<-S8.getLineb<-S8.getLineif(issubab)thenreturn("YES")elsereturn("NO")mapM_putStrLnarr
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Substring Searching
You are viewing a single comment's thread. Return to all comments →
this is my solution , but test case 5 got wrong,I download the test case file,but the result is right,I dont know why