If current permutation meets the conditions , increment answer
if ( noOfbarsVisibleFromLeft ( v ) == K ) : NEW_LINE INDENT ans += 1 NEW_LINE DEDENT v = nextPermutation ( v ) NEW_LINE if v == temp : NEW_LINE INDENT break NEW_LINE DEDENT return ans NEW_LINE