Technology Sharing

[Likou] Daily Question - Question 217, repeated elements

2024-07-11

한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina

Table of contents

topic:

Starting ideas:

Change of ideas:

Above code:


topic:

Given an array of integers nums If any value appears in the arrayAt least twice ,returntrue ; If each element in the array is different, returnfalse

Starting ideas:

Violently solving the double for loop directly produces the result, but it times out! ! !

Timeout, what a miserable life!!!

Change of ideas:

Sorting first and then traversing successfully

Hey, that's all, hehehe

Above code:

int cmp(const void *x,const void *y)
{