We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Mathematics
- Fundamentals
- Filling Jars
- Discussions
Filling Jars
Filling Jars
Sort by
recency
|
198 Discussions
|
Please Login in order to post a comment
For C++ solution change the return type of solve function to long long and also type of result variable in main function from where solve is being called.
Java int array [ ] = new int[n]; for(List operation: operations){ int a = operation.get[0]-1; int b = operation.get[1]-1; int k = operation.get[2]; for(int i=a; i<=b; i++){ array[i]+= k; } }
Python: