An Interest In:
Web News this Week
- April 2, 2024
- April 1, 2024
- March 31, 2024
- March 30, 2024
- March 29, 2024
- March 28, 2024
- March 27, 2024
October 28, 2021 09:43 am GMT
Original Link: https://dev.to/coderduck/code-everyday-with-me-2f86
code everyday with me
--DAY 10--
Hi, I am going to make #100DaysOfCode Challenge. Everyday I will try solve 1 problem from leetcode or hackerrank. Hope you can go with me until end.
Now let's solve problem today:
-Problem: Subarray Division
-Detail: https://www.hackerrank.com/challenges/the-birthday-bar/problem
-My solution (javascript):
function birthday(arr, d, m) { let ans=0,s=0; for(let i=0;i<arr.length;i++){ for(let j=i;j<(i+m);j++) s+=arr[j]; if(s==d) ans++; s=0; } return ans;}
-->If you have better solution or any question, please comment below. I will appreciate.
Original Link: https://dev.to/coderduck/code-everyday-with-me-2f86
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To