Try these rules within the .htaccess file inside your document root directory:

RewriteRule ^problem/getproblems/fieldset/2/([^/]+)/([^/]+)/(.+)$ /problem/getproblems/fieldset/2/$3?$1=$2 [N,QSA]
RewriteRule ^problem/getproblems/fieldset/2/([^/]+)/([^/]+)$ problem/getproblems/fieldset/2?$1=$2 [L,QSA]

The very first rule is perfect for the recursion and also the second rule finishes the recursion.

Certainly something similar to

^(.*)\?(search)=(.+)&(rows)=(.+)&(page)=(.+)$ $1/$2/$3/$4/$5/$6/$7

works, but regardless of whose answer you follow, you'll always have to tweak it for your situation, so you must know how it operates., and something similar to will enable you to get a lengthy way.