DSA Flashcards

1
Q

Contains Duplicate

A

Arrays & Hashing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Valid Anagram

A

Arrays & Hashing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Two Sum

A

Arrays & Hashing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Group Anagrams

A

Arrays & Hashing
charCodeAt()
Array.toString()
alphabet has 26 letters
if key in object
for key in object: do something with object[key]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Top K Frequent Elements

A

Arrays & Hashing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Encode and Decode Strings

A

Arrays & Hashing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Product of Array Except Self

A

Arrays & Hashing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Valid Sudoku

A

Arrays & Hashing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Longest Consecutive Sequence

A

Arrays & Hashing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Valid Palindrome

A

Two Pointers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Container With Most Water

A

Two Pointers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Two Sum II Input Array Is Sorted

A

Two Pointers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

3Sum

A

Two Pointers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Trapping Rain Water

A

Two Pointers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Evaluate Reverse Polish Notation

A

Stack

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Generate Parentheses

14
Q

Valid Parentheses

15
Q

Min Stack

16
Q

Daily Temperatures

17
Q

Largest Rectangle In Histogram

18
Q

Car Fleet

19
Q

Search a 2D Matrix

A

Binary Search

20
Q

Binary Search

A

Binary Search

21
Q

Best Time to Buy And Sell Stock

A

Sliding Window

22
Q

Reverse Linked List

A

Linked List

23
Q

Merge Two Sorted Lists

A

Linked List

24
Q

Reorder List

A

Linked List. Solution A add list to an array and then simply adjust pointers. Solution B. split linked list in half. Reverse the second half. Merged the linked lists (better space complexity). Both O(n) solutions

25
Q

Remove Node From End of Linked List

A

Linked List. Need to use a dummy node and two pointers

26
Q

Copy Linked List with Random Pointer

A

Linked List. Need to use Map. Need to remember map.set() map.get() for([key, value]

27
Q

Invert Binary Tree

28
Q

Maximum Depth of Binary Tree

29
Q

Diameter of Binary Tree

30
Q

Balanced Binary Tree

31
Q

Same Tree