C # program for Finite Automata Pattern searching Algorithm
using System ; class GFG { public static int NO_OF_CHARS = 256 ; public static int getNextState ( char [ ] pat , int M , int state , int x ) {