What is the distribution of the number of guesses in this game? The question is inspired by a game that went viral on Chinese SNSs recently.

Assume there are two people A and B. A thinks of a random permutation of $1$ to $N$ (e.g., $N=7$, the sequence can be $2614735$). Then B guesses it. After each turn, B is told which numbers he just guessed were correct, and which ones were wrong. Obviously, it takes at least $1$ attempt and at most $N$ attempts for B to get the correct answer (the last turn counts). Here is the question: What is the distribution of B's number of attempts $k$? 
(Apparently the probability of getting it correct on the first try ( $k=1$) is $\frac{1}{N!}$, but just calculating the probability of $k=2$ seems like chores. Is there an easy way to do the problem?)
Added: I realize that it is necessary to provide player B's strategy. The natural way is to assume that B follow the optimal strategy, and "optimal" is defined as to minimize the expected value of $k$. However we've not known how to calculate the expected $k$ (for the strategy below) yet. To simplify, we may temporarily assume the strategy as to guess "all the discovered numbers are in their known places and then to guess any permutation of the undiscovered numbers" every time (description by @Steve Kass), which is suspected but not proven to be optimal.

Here is an example of the gameplay ($N=7$).
A thinks of a sequence: 2614735.
B guesses: 1234567. A:1234567
B guesses: 2354671. A:2354671
B guesses: 2564713. A:2564713
B guesses: 2614735. A:2614735, correct! ($k=4$)
 A: Here is an approach to approximate the expected number of guesses.  Let $n(r)$ be the expected number of correct guesses on round $r$.  By the linearity of expectation, $n(1)=1$ independent of $N$.  As we guess, we can keep track of the numbers still possible at each position. We assume that each round the permutation guessed has a possible number in each location.  Each round the positions that have never been guessed correctly lose as possible numbers the number that was guessed and any numbers that are discovered to be in the correct position somewhere else.  The number of possibilities at a position after round $r$ is then $N-r-\sum_{i=1}^r n(i) + \text {losses}$ where losses represent cases where a number was eliminated from a position by a guess and was later eliminated by having its correct position found.  The losses term comes from inclusion/exclusion where we have subtracted that possibility twice so need to add it back in.  Taking the two excluded sets as uncorrelated, we have losses=$r(\sum_{i=1}^r n(i))/N$, so the expected number of new locations found is $\frac {N-\sum_{i=1}^r n(i)}{N-r-\sum_{i=1}^r n(i)+r(\sum_{i=1}^r n(i))/N}$. I made a spreadsheet to compute the expected number of known locations after $r$ rounds as a function of $N$.  In this (perhaps) silly model the expected number of rounds is between $0.6N$ and $2N/3$, decreasing as $N$ rises to $2000$.  You spend a long time getting just one new correct location per round, but then things shoot up as you have eliminated many of the possibilities.  Lots of handwaving but I suspect not far wrong.
A: Here’s an approach to try, but not a complete answer. Perhaps someone can work out the details. [Added: It also looks like it's not right at this point...]
Note added: This analysis assumes that player $B$ never makes a known wrong guess for the position of any digit. (In the OP’s example game, player B does follow this strategy.) I’m not sure if this is an optimal strategy, but some assumption about $B$’s strategy is necessary for the problem to be well-defined.
Suppose that after $B$’s $k$-th guess, $u$ digits remain undiscovered. The location of any of the $u$ undiscovered digits, which could originally have been in any of $7$ possible positions, can now be in only $u-k$ positions. Notably, the number of possible positions for each undiscovered digit is the same.
Model the game as an absorbing Markov chain, where $S_{u,k}$ is the state of the game if $k$ guesses have been made and $u$ digits remain undiscovered. The initial state of the game is $S_{7,0}$ and the terminal (absorbing) states of the game are the states $S_{0,k}$.
If the game is in a non-absorbing state $S_{u,k}$ and the next guess reveals $j$ additional digits, the game state moves to $S_{u-j,k+1}$.
If the transition probabilities are known, the expected number of guesses to win the game can be found by a known technique. I suppose there are also known formulas that make it possible to find the distribution of stopping times.
So what remains, before applying standard techniques, is to compute the probability distribution of discovering $j$ digits out of $u$ undiscovered digits, each of which is in exactly one of $u-k$ positions. Some of the probabilities are straightforward. For example, $p(S_{u,u-1}\to S_{7,u})=1$. I suspect there’s no closed form for the probabilities, since I think there is no closed form for the distribution of fixed points of a random permutation. However, it should be computationally feasible to figure everything out when the number of digits is $7$.
