#.
1 messages · Page 1 of 1 (latest)
like lru cache?
tagged?
they make u walk through a test case?
nah its not trie
is it not just a basic freq counter
and break early if freq of a certain character exceeds
like arr of size 26 then map each char to idx assuming all lowercase
then same thing for each word in list
yeah i mean you have to do that regardless no
if thats what u did should be fine
ya just verifeid with gpt too
how can you not iterate through each word
lol
even if u build a tire
u need to
wait wdym
you only iterate once
how, isnt it going to be 26^n
you build the freq counter with the given letters
and then iterate thorugh each word in the list once
keep track of longest
bro
yes
thats o(1)
for each
O(26)
bro
what do u want lol
O(1) total TC?
lmfoa
you cant get better than O(n * M)
ya ur interviwe dumnb
maybe they just wanted anotehr veriosn
but if they explicty said tis more optimal they need to hop back on the LC grind
cuz they dunno what they talkg ibatbotu
ya sometiems they want something else eevn if what u have is optimal
juist depends
if preporessing doesnt count towards TC/SC then yea ur right i think
TC sohuld be same for both apporaches but trie is more memory
oh muiltiple queires
like multiple lists?
oh so youre given like multiple potentail characters?
then that makes more sense
for trie
ya then trie makes sense
ok ya i thought it was just the thing on stacak overflow
nvm then
did you move on to VO?