Pergunta de entrevista da empresa Vanguard

What is a pointer? What is a stack and how would you use one? How would you tell if two strings are permutations?

Resposta da entrevista

Sigiloso

23 de ago. de 2018

"AAB" "ABA" ans1: sort each string and compare ans2: store each character from the first string in a hashmap that takes the letter as a key and its frequency as the value. iterate through the second string and subtract one from the value of the corresponding letter. if the hashmap values are all zero than it is a permutation.