Skip to main content

Time Complexity · #35 · 2026-05-09

What's the Big-O?

Rust ·Difficulty 1/3

How to play

Read the code and pick its time complexity from four Big-O choices. Think about loops, recursion, and hidden costs. Press 1–4 or click to answer.

n = nums.len(). What is the time complexity?

fn unique_sorted(mut nums: Vec<i32>) -> Vec<i32> {
    nums.sort();
    nums.dedup();
    nums
}

Loading your progress...

Press 1 through 4, or tap a numbered choice, to answer. Back to hub