注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号 
x
题目很直截了当:
# Name Matching
#
# At Checkr, one of the most important aspects of our work is accurately matching records
# to candidates. One of the ways that we do this is by comparing the name on a given record
# to a list of known aliases for the candidate. In this exercise, we will implement a
# `name_match` method that accepts the list of known aliases as well as the name returned
# on a record. It should return True if the name matches any of the aliases and False otherwise.
#
# The name_match method will be required to pass the following tests:
#
# 1. Exact match
#
# known_aliases = ['Alphonse Gabriel Capone', 'Al Capone']
# name_match(known_aliases, 'Alphonse Gabriel Capone') => True
# name_match(known_aliases, 'Al Capone') => True
# name_match(known_aliases, 'Alphonse Francis Capone') => False
#
#
# 2. Middle name missing (on alias)
#
# knowwn_aliases, 'Gabriel Francis Capone') => False
#
#
# 7. Last name cannot be transposed
#
# 'Alphonse Capone Gabriel' is NOT a valid transposition of 'Alphonse Gabriel Capone'
# 'Capone Alphonse Gabriel' is NOT a valid transposition of 'Alphonse Gabriel Capone'
#
# known_aliases = ['Alphonse Gabriel Capone']
# name_match(known_aliases, 'Alphonse Capone Gabriel') => False
# name_match(known_aliases, 'Capone Alphonse Gabriel') => False
# name_match(known_aliases, 'Capone Gabriel') => False
|