Problem

Return length of common prefix of a and b.

Examples

  • commonPrefixLen("abc", "abx") -> 2
Compile and test (Ctrl+Enter)