HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Unsorted > problem:


Find all duplicates in array

Section problems

• Копилка
• Коррекция кода
• Куб
• Maze
• Лесенки
• Skiers
• Максимум из минимумов
• Маршрут
• Find all duplicates in array
• Find the Missing number
• Matrix
• Range Minimum Query
• Министерство правды
• Coins and nests
• Монополия
• Муравей
• Ball

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb. Difficulty Beta

Оң жана бүтүн сандардын тизмеси берилди. Тизмедеги ар бир сан бир же эки жолу гана кезигиши мүмкүн. Эки жолу гана кезиккен сандардын тизмесин өсүү тартибинде чыгарып бергиле. Эгерде шартка ылайыктуу сандар такыр жок болсо, анда англисче EMPTY (Созсуз баш тамгалар менен) созун чыгаргыла.

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.

Мисалдар:

input1: 4 3 2 7 8 2 3 1
output1: 2 3

input2: 1 1 2
output2: 1

input3: 1
output3: EMPTY

Для отправки решений необходимо выполнить вход.

www.contester.ru