Find S Algorithm Using Pseudocode