HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Создуктор (Dictionary) > problem:


01. Find all duplicates in array

Volume problems

• 01. Find all duplicates in array
• 02. Integer to English words / Санд...
• 03. Dictionary from String
• 04. Сoordinate quarters
• 05. Scrabble
• 06. Sort People
• 07. Find the Missing number
• 08. Бутун сандар массиви
• 09. Roman to integer

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