1/26
Loading...
🔐Password Hacking Start!
Change one letter at a time from "cat" to "dog"!
Loading...
Change one letter at a time from "cat" to "dog"!
A hacker tries to access the system. The initial password must be transformed to the target password. Only one character can be changed at a time. The changed password must exist in the valid password list. Find the minimum number of transformations.
begin = "cat", target = "dog", words = ["cot", "dot", "dog", "dat", "dag"]
3
cat → cot → dot → dog (3 steps)