Pergunta de entrevista da empresa PayPal

Write a method to determine if 2 strings are anagrams.

Respostas da entrevista

Sigiloso

21 de set. de 2019

Let me try to ans this: Declare String variables str1, str2 and get values in it. check for length match first to decide upfront. only if they match go ahead further. Declare 2 Arrays of Chars[str1.length and str2.length] convert strings to arrays next. Compare each char of first array with second array in 2 loops to find a match. if found then make the value in second array empty and continue loop. if not found break; return false. once all traversed-check for empty array of second-return true otherwise false.

Sigiloso

22 de ago. de 2019

I tried rooftop slushie mentioned above and it was pretty helpful. I recommend it.