Hamming Distance

ABC 399

Problem 17 of 50

Easy

What to do

You have two strings of the same length made up of lowercase letters. Your task is to count how many positions in these strings have different letters.

Key Concepts

loops conditional statements string manipulation counting

Examples

Input: 'abcarc', 'agcahc'

Output: 2

Input: 'atcoder', 'contest'

Output: 7

Tips for Beginners

  • Focus on understanding the logic, not memorizing syntax
  • Use print statements to debug your code
  • Don't worry about input parsing - the function handles that for you
  • If stuck, try writing out your solution on paper first

Python Editor

Loading Python...