L= { w is {1,2,3}*
| w starts with 3, ends with 2 and there is a substring of only 1 with length
even equal or >2}.
所以一些測試的結果一定是:正則表達式運動
3323112: accepted
311211112: non accepted
31112: non accepted
32: non accepted
2113: non accepted
313212: non accepted
我的回答是:3*(11)*2*
但它沒有一些測試......有人能幫助我嗎?
的第二運動是:
L= { w is {1,2}*
| in w after every 1 there is one or more 2, but if the 1 is the last
character it could be the last (no 2 after it)}
測試字符串:
1: accepted
222: accepted
221212122: accepted
1222121: accepted
111221: not accepted
11: not accepted
我的解決辦法是(12*)*
但它沒有一些測試......請幫助我。
我懷疑這個問題屬於[cstheory.se] –
爲什麼311211112在第一個練習中被拒絕?它滿足您列出的所有條件(從3開始,以2結尾,並且包含具有偶數長度的1的序列)。 –