Comments (5)
@rosdyana hey thanks for the new challenge! i think you forgot the goal / challenge of the problem. would this be correct?
your function should accept a comma-separated string input of earning/spending activity and return the sum of earnings as a single
int
value
from hacktoberithms.
@the-vampiire yeah, you're correct 👍
from hacktoberithms.
In the test data, can you explain why the streak is 5?
input:
1,3,-2,1,2
output:
5
I think it should be 4 starting on the 1st day and ending on the 2nd day.
from hacktoberithms.
hi @mikelane , it's 5 because the spending (-2) is less than earning (1+3), he still have $2 , so it's not broke the rules.
the second example
0,7,0,2,-12,3,0,2
after got $9 from earning, he spent $12, and the balance become minus, so it's broke the rules and need start counting the highest earning from 6th till 8th days
from hacktoberithms.
Should this be able to handle float values?
from hacktoberithms.
Related Issues (10)
- Sum of All Numbers HOT 3
- Profile Lookup
- Mutations HOT 2
- Braille Translation HOT 3
- Lovely Lucky Lambs HOT 2
- Power Hungry HOT 1
- Valid Parenthesis HOT 4
- Multiple Cash Registers
- Coin Gift
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hacktoberithms.