문제: app.codility.com/programmers/lessons/4-counting_elements/perm_check/
List<int> ListA = new List<int>(A);
ListA.Sort();
int index = ListA.Count;
if (index == 0)
return 0;
for (int i = 0; i < index; i++)
{
if (ListA[i] != i + 1)
return 0;
}
return 1;
'공부하자 > Codility' 카테고리의 다른 글
[Codility] Lesson5. GenomicRangeQuery (C#) (0) | 2020.11.17 |
---|---|
[Codility] Lesson5. CountDiv (C#) (0) | 2020.11.17 |
[Codility] Lesson4. MissingInteger (C#) (0) | 2020.11.17 |
[Codility] Lesson4. MaxCounters (C#) (0) | 2020.11.17 |
[Codility] Lesson4. FrogRiverOne (C#) (0) | 2020.11.17 |