Finite State Machine: Check Whether String Contains ‘abb’ or not

import java.io.*;
public class Noabb
{
public static void main(String[] args)throws IOException
{
BufferedReader obj = new BufferedReader (new InputStreamReader (System.in));
int state[][]={{1,0},{1,2},{1,3},{3,3}};
int q =0;
String str;
System.out.println(“Enter your string”);
str=obj.readLine();

for(int i=0;i

Leave a Reply

Your email address will not be published. Required fields are marked *