#303. 字符串末尾匹配(忽略大小写)
字符串末尾匹配(忽略大小写)
String End Match
Background
Dawei and Xiaoxiao are playing a string game.
Problem Description
Given two strings, return true if either of the strings appears at the very end of the other string, ignoring upper/lower case differences (in other words, the computation should not be "case sensitive"). Note: str.toLowerCase() returns the lowercase version of a string.
Input Format
The input consists of a single line containing two strings, separated by " ".
string1" "string2
Output Format
Output a boolean value, true or false.
boolean_result
Sample
Hiabc" "abc
true
AbC" "HiaBc
true
abc" "abXabc
true
Sample Explanation
For Sample 1, the lowercase of "Hiabc" is "hiabc", and the lowercase of "abc" is "abc". "abc" appears at the very end of "hiabc", so true is returned.
For Sample 2, the lowercase of "AbC" is "abc", and the lowercase of "HiaBc" is "hiabc". "abc" appears at the very end of "hiabc", so true is returned.
For Sample 3, the lowercase of "abc" is "abc", and the lowercase of "abXabc" is "abxabc". "abc" appears at the very end of "abxabc", so true is returned.
Constraints
Time limit: 1s, Memory limit: 1024KiB for each test case.