Leetcode 442. Find All Duplicates in an Array

Опубликовано: 11 Октябрь 2024
на канале: Lit Code
90
6

Leetcode 442. Find All Duplicates in an Array - Python Solution

Problem Statement: [https://leetcode.com/problems/find-al...]
Given an integer array nums of length n where all the integers of nums are in the range [1, n] and each integer appears once or twice, return an array of all the integers that appears twice.

You must write an algorithm that runs in O(n) time and uses only constant extra space.