LeetCode Club First Contest

LeetCode Club First Contest

University

24 Qs

quiz-placeholder

Similar activities

Data Structures and Algorithms Quiz

Data Structures and Algorithms Quiz

University

20 Qs

Forensics Types of Evidence Vocabulary

Forensics Types of Evidence Vocabulary

10th Grade - University

22 Qs

Technical Quiz R-1

Technical Quiz R-1

University

20 Qs

Data Structures and Algorithms Quiz

Data Structures and Algorithms Quiz

University

25 Qs

Linear momentum

Linear momentum

KG - University

20 Qs

PSD 09_09_21

PSD 09_09_21

University

20 Qs

UAS DPK

UAS DPK

University

25 Qs

Cloud computing and distributed system

Cloud computing and distributed system

University

20 Qs

LeetCode Club First Contest

LeetCode Club First Contest

Assessment

Quiz

Science

University

Hard

Created by

Thanh Dat Vu

Used 2+ times

FREE Resource

24 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

What's the time complexity of the two-pointer approach in LeetCode 125 (Valid Palindrome)? 

O(n) 

O(n^2)

O(log n)

O(1)

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Select all the the space complexity if it’s indicates that the memory requirement grows with the total size of >= input.

O(1), O(n^2) , O(n - m)

O(2n), O(m+n) , O(1)

O(m+n), O(n)

O(max(m,n)), O(1)

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of the following is NOT a valid way to reverse a string in Python? 

s[::-1]

 .join(reversed(s)) 

s.reverse() 

join(s[i] for i in range(len(s)-1, -1, -1))

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

In the context of the LeetCode 121 problem, which statement about the algorithm's approach to finding the maximum profit is most accurate

The algorithm only considers the stock prices on the days when the maximum profit occurs.

The algorithm relies on updating both min_price and max_profit simultaneously as it iterates through the stock prices.

The algorithm uses a nested loop to compare every possible buy-sell pair, leading to a time complexity of O(n²).

The algorithm assumes that stock prices can only increase, leading to potential inaccuracies in profit calculation.

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

What's the time complexity of the optimized solution for LeetCode 122 (Best Time to Buy and Sell Stock II) (1 loop)? 

O(n)

O(n^2)

O(log n)

O(n log n)

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

In many Linked List Problems, what's the purpose of the dummy node?

To simplify edge cases

To improve time complexity

To reduce space complexity

To reverse the linked list

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

What's the space complexity of the Floyd's Cycle-Finding Algorithm used in LeetCode 141 (Linked List Cycle)? 

O(1)

O(n) 

O(log n)

O(n^2)

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?