Find The Difference leetcode

preview_player
Показать описание
You are given two strings s and t.

String t is generated by random shuffling string s and then add one more letter at a random position.

Return the letter that was added to t.
Рекомендации по теме
Комментарии
Автор

Simply do the Xor of all letters in both strings. In constant space n linear time

sasidharnaidu
Автор

sort both array and loop through their indexes in linear time and constant space..

qwertyuiop