Skip to content

Instantly share code, notes, and snippets.

@gauravkoradiya
Created April 25, 2020 14:01
Show Gist options
  • Select an option

  • Save gauravkoradiya/1d7490d1dfcf7d4eb7a8f9b94aa87724 to your computer and use it in GitHub Desktop.

Select an option

Save gauravkoradiya/1d7490d1dfcf7d4eb7a8f9b94aa87724 to your computer and use it in GitHub Desktop.

Revisions

  1. gauravkoradiya created this gist Apr 25, 2020.
    19 changes: 19 additions & 0 deletions LRNDSA01_CARVANS.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    # https://www.codechef.com/problems/CARVANS

    def main():
    for T in range(int(input())):
    num_cars = int(input())
    speed = map(lambda x: int(x) , input().split())
    count = 0
    max_speed = float('inf')
    for i in speed:
    if i < max_speed:
    max_speed = i
    count+=1
    print(count)




    if __name__ == '__main__':
    main()