An Interest In:
Web News this Week
- March 21, 2024
- March 20, 2024
- March 19, 2024
- March 18, 2024
- March 17, 2024
- March 16, 2024
- March 15, 2024
October 20, 2021 12:36 am GMT
Original Link: https://dev.to/coderduck/code-every-day-with-me-3fob
code every day with me
--DAY 2--
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.
This is 2nd day:
-Problem: Staircase
-Detail: https://www.hackerrank.com/challenges/staircase/problem
-My solution (javascript):
function staircase(n) { let line=[]; line.length=n; line.fill(' '); for(let i=0;i<n;i++){ line.shift(); line.push('#'); console.log(line.join('')); }}
--> If you have better solution or any question, please comment below. I will appreciate.
Original Link: https://dev.to/coderduck/code-every-day-with-me-3fob
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