Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

permcheck codility python

def solution(A):

    A = sorted(A)
    ans = 1

    for i in range(0, len(A)):
        if A[i] == ans:
            ans += 1
        else:
            break

    if ans == len(A)+1:
        return 1
    return 0
Comment

PREVIOUS NEXT
Code Example
Python :: while attempts 0: 
Python :: programe to find contagious sum of sequence 
Python :: moviepy not able to read the image file format 
Python :: Python Key Gen 
Python :: jinja 2 iterate over dictionary 
Python :: asyncio RuntimeError: Event loop is closed 
Python :: setting price variable in 3 categories python 
Python :: return tuples form functions in Python 
Python :: kivy lang 
Python :: run all jupyter notebooks in project folder 
Python :: update cell in sheet by column name using pandas 
Python :: xtick for axvline 
Python :: generate-thumbnails-in-django-with-pil 
Python :: fouier transformation in python open cv 
Python :: arm str example 
Python :: check if a date is reached django 
Python :: combining list alternatively 
Python :: write a variable and assin a string to it 
Python :: google translate english to spanish 
Python :: delete csr python 
Python :: mak a scipy csr sparse matrix 
Python :: concat with zero array numpy 
Python :: assertRaises property 
Python :: import cv2 illegal instruction (core dumped) 
Python :: download python for windows 7 32 bits 
Python :: yesterday date in python 
Python :: unique items in a list python 
Python :: python hide terminal 
Python :: *args in python 
Python :: typing python 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =