profile
차근차근 하나씩
post-thumbnail

[HackerRank] Two Strings

Problem Given two strings, determine if they share a common substring. A substring may be as small as one character. Example s1 = 'and' s2 = 'art' These share the common substring a. s1 = 'be' s2 = 'cat' These do not share a substring. Function Description Complete the function twoStrings in the editor below. twoStrings has the following parameter(s): string s1: a string string s2: another string Returns string: either YES or NO Input Format Th

2021년 4월 15일
·
0개의 댓글
·
post-thumbnail

[HackerRank] Hash Tables: Ransom Note

Problem Harold is a kidnapper who wrote a ransom note, but now he is worried it will be traced back to him through his handwriting. He found a magazine and wants to know if he can cut out whole words from it and use them to create an untraceable replica of his ransom note. The words in his note are case-sensitive and he must use only whole words available in the magazine. He cannot use substrings or concatenation to create the words he needs. Given the words in the magazine and the words in

2021년 4월 15일
·
0개의 댓글
·