# https://www.tutorialspoint.com/python_data_structure/index.htm

# warmup questions
# https://www.hackerrank.com/challenges/counting-valleys/problem?isFullScreen=true
    


def countingValleys(steps, path):
    """count no. steps climbing up to sea level"""
    seaLevel = valley = 0

    for step in path:
        if step == 'U':
            seaLevel += 1
        else:
            seaLevel -= 1
        
        if step == 'U' and seaLevel == 0:
            valley += 1
    return valley


# LIST -------------------
a = [23,21,50,1,5]
# updating a value by index
a[0] = a[0] + 1
# removing a value
a.remove(23)
# get index from value
a.index(50)


# WHILE LOOPS -------------------
# loop complete when len(a) == 0
while a:
    for i in a:
        a.remove(i)



# SORTING -------------------
# where possible, use python sorted function
# it uses Timsort, an efficient sorting method
sorted(a, reverse=True)

@@ -161,20 +161,105 @@
 en=true%0A
-    
+# https://www.hackerrank.com/challenges/jumping-on-the-clouds/problem?isFullScreen=true%0A%0A
 %0A%0A%0Adef c
@@ -548,24 +548,24 @@
 valley += 1%0A
-
     return v
@@ -572,16 +572,479 @@
 alley%0A%0A%0A
+def jumpingOnClouds(c):%0A    %22%22%22use while loop or recursive%22%22%22%0A    jumps = 0%0A    # %22000%22 = 2%0A    # %22010%22 = 2%0A    # %2200%22 = 1%0A    c = %22%22.join(str(i) for i in c)%0A    while len(c) %3E 1:%0A        if c%5B:3%5D == %22000%22:%0A            c = c.replace(%22000%22, %2200%22, 1)%0A        if c%5B:2%5D == %2200%22:%0A            c = c.replace(%2200%22, %220%22, 1)%0A            jumps += 1%0A        if c%5B:3%5D == %22010%22:%0A            c = c.replace(%22010%22, %220%22, 1)%0A            jumps += 1%0A            %0A    return jumps%0A%0A%0A%0A%0A
 # LIST -

Update algorithm_tests.py