[Swift] LCP 1. Guess

★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
➤ micro-channel public number: Shan Wing Chi ( let_us_code)
➤ bloggers domain: https://www.zengqiang.org
➤GitHub address: https://github.com/strengthen/LeetCode
➤ original address: https://www.cnblogs.com/strengthen/p/12151699 .html
➤ If the address is not a link blog Park Yong Shan Chi, it may be crawling author of the article.
➤ text has been modified update! Click strongly recommended that the original address read! Support authors! Support the original!
★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★

A small play and a small B Guess. Small B per 1, 2, 3 from a randomly selected, each time selecting a small A guess from 1, 2, 3. They conducted a total of three times in this game, return to the small A guessed a few times?

 

guess input array A small each guess, answer choices for each small array B. guess and 3 are equal to the length of the answer.

 

Example 1:

Input: guess = [1,2,3], answer = [1,2,3]
Output: 3
Explanation: A small every guess.
 

Example 2:

Input: guess = [2,2,3], answer = [3,2,1]
Output: 1
Explanation: A small only a second guess.
 

limit:

3 the length of the guess =
answer length = 3
guess element values {1, 2, 3} one.
answer element values {1,, one 23}.

Guess you like

Origin www.cnblogs.com/strengthen/p/12151699.html