Grokking the Coding Interview: Patterns for Coding Questions
Ask Author
Back to course home

0% completed

Vote For New Content

Single HashMap is enough.

AnonymousAdam

Sep 2, 2024

0

46

0

Sep 2, 2024

Space complexity is wrong -> O(1)

shanehowe100

Aug 30, 2024

1

20

1

Dec 11, 2024

Simpler solution.

Mohammed Dh Abbas

Jul 9, 2024

0

43

0

Jul 9, 2024

Mismatch between constraint and test cases

Kai

May 9, 2024

2

25

1

Jun 17, 2024

The classic and magic solution!

Anonymoussealess

Mar 31, 2024

0

37

0

Mar 31, 2024

if the character going out was in hashmap, put it back in the hashmap??

Faraz

Mar 31, 2024

0

13

1

Jul 22, 2024

wrong space complexity analysis

Popa Stefan

Jan 3, 2024

1

20

1

Jan 29, 2024

Hashmap additions???

arya.javadi80

Aug 19, 2023

1

22

0

Mar 31, 2024

Alternate C++ solution -- 2 maps

Roberto Pantoja

Jun 15, 2023

0

9

0

Jun 15, 2023

"if window_end >= len(pattern) - 1" could be replaced by "if window_end == len(p...

Douglas

Dec 5, 2022

0

26

0

Dec 12, 2023

Can someone help me with the time/space complexity of this solution?

Anthony DiFede

Nov 17, 2022

1

13

1

Mar 31, 2024

Actually, no windows shrinking is required to solve the task. We jus go forwar...

Viacheslav Lushchinskiy

Nov 15, 2022

1

38

0

Mar 31, 2024

Hey, I don't understand how "if window_end >= len(pattern) - 1" check works for ...

Viktor

Oct 25, 2022

1

21

1

Dec 6, 2024

why do we need to compare the len(matches) to the len(freq) why not something el...

Daniel Lim

Sep 16, 2022

0

8

2

Dec 5, 2022

Isn't the time complexity just O(n)? since it will always be the case that n >= ...

Alfonso Vieyra

Sep 6, 2022

0

5

1

Sep 9, 2022

When I enter this solution on leetcode it is giving me an error. https://leetcod...

Jared

Aug 15, 2022

0

18

7

Aug 16, 2022

I personally like going without the matched variable and instead checking if the...

Christian Salinas

Jul 22, 2022

1

18

2

Dec 5, 2022

I've done it like this: using 2 hashMaps, one of them to "reset" the original ha...

Clodoaldo Favaro

Jul 19, 2022

1

16

1

Dec 5, 2022

"If at any time, the number of characters matched is equal to the number of dist...

dg

May 17, 2022

0

14

1

Jun 15, 2022

How about bit masking?function isPermuationInString(str, pattern) { const bit...

Zack Avino

Mar 30, 2022

0

5

1

Jul 6, 2022

Shouldn't the condition for shrinking the window be windowLength > patternLength...

Alex

Mar 2, 2022

0

14

3

Oct 25, 2022

Go based solutionfunc findPermutation(input, pattern string) bool { winStart := ...

Bipra

Feb 13, 2022

0

6

5

May 24, 2022

Should we be able to answer the problem challenges on our own after going throug...

Joshua Causey

Dec 8, 2021

3

35

4

Mar 31, 2024