Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.

Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).

Input: "a", "c", ["a","b","c"] Output: 1 Expected: 2

According to the problem description, I could change "a" -> "c" and the length turns out to be 1. I am confused by the expected answer... Did I miss something out?

As one shortest transformation is "hit" -> "hot" -> "dot" -> "dog" -> "cog", return its length 5.

The length of the list is the number of elements, not the number of changes. Since there is "a" and "c", the answer is 2.

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.