Python-algos: Largest Continuous Sum

def large_cont_sum(arr): 

if len(arr)==0:
return 0

max_sum = current_sum = arr[0]

for num in arr[1:]:
current_sum = max(current_sum + num, num)
max_sum = max(current_sum, max_sum)
return max_sum

--

--

--

Problem solver with experience in Software, and Mechanical engineering. Interested in web-dev, machine learning, artificial intelligence, and new technologies.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Turning CSVs Into SQLite Tables with Python

VoiceBot IVR —Build Your Own Call Centre with Twilio + Python Flask

An Introduction to Git and GitHub for Beginners

Install VirtualBox 6.1 on Ubuntu 18.04 or 20.04 via Official repository + web GUI

Apple MacBook Owner? A List of Useful Key Shortcuts for Better Performance

Main advantages of GraphQL as an alternative to REST

My first iOSapp

What is Web Scraping?

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Avitosh Totaram

Avitosh Totaram

Problem solver with experience in Software, and Mechanical engineering. Interested in web-dev, machine learning, artificial intelligence, and new technologies.

More from Medium

Heaps, the python way

heap

Creating a Book Class 📚

Solving LeetCode-Climbing Stairs With Python

LeetCode Patterns Adventure 14— Remove Duplicates from Sorted List