diff --git a/Part-1-Functions b/Part-1-Functions index df3f09d..b659b7f 100644 --- a/Part-1-Functions +++ b/Part-1-Functions @@ -21,8 +21,22 @@ # arrayCheck([1, 1, 2, 1, 2, 3]) → True def arrayCheck(nums): - # CODE GOES HERE - +num=[1,2,4,3] +c=0 +s=0 +print(num) +for i in num: + if num[s]==1: + if num[s+1]==2: + if num[s+2]==3: + c=1 + s=s+1 +if c==1: + print("true") +else: + print("false") + + ##################### ## -- PROBLEM 2 -- ## @@ -38,7 +52,13 @@ def arrayCheck(nums): # stringBits('Heeololeo') → 'Hello' def stringBits(str): - # CODE GOES HERE + str="siddharth" + s=0 + n=len(str) +for i in range(len(str)): + print(str[s]) + s=s+2 + ##################### @@ -120,4 +140,8 @@ def fix_teen(n): # count_evens([1, 3, 5]) → 0 def count_evens(nums): - # CODE GOES HERE + for i in count_evens + if count_evens[i]%2==0: + count=count+1 + +return count