Identify Extra Character

STRING

Problem

Given two strings original and modified, where modified contains all the characters of original plus one additional character, return the extra character in modified.

Examples

findExtraCharacter("hello", "hellow") // returns "w" // The extra char in 'hellow' compared to 'hello' is 'w' findExtraCharacter("world", "orwtld") // returns "t" // The extra char in 'orwtld' compared to 'world' is 't' findExtraCharacter("example", "pexaeyml") // returns "y" // The extra char in 'pexaeyml' compared to 'example' is 'y'
Loading...