I was taking some of the challenge questions in JS and I stumbled upon this one 👇 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

I was taking some of the challenge questions in JS and I stumbled upon this one 👇

Fill in the blanks to get the following output: 2221 2211 2111 #by Norayr Gaspar var size = __ ; for(let i = 1; i < size; i++) { for(let k = 0; k < size - i; k++) { document.write(__); } for(let k = 0; k < i; k++) { document.write(__); } document.write("<br>"); } And then I was just wondering 🤔 How does someone expect a human to solve this challenge in 30 seconds? How?

4th Sep 2023, 7:27 AM
eMBee
eMBee - avatar
2 Answers
+ 2
It comes from practice If you do more practice you can solve in 10 seconds Since matrix is of 4 * 3 So inner loops should works 4 times and outer loop should works 3 times so for outer loop size = 4 And print 2 in first statement and 1 in 2nd statement.
4th Sep 2023, 8:24 AM
A͢J
A͢J - avatar
0
One of many examples of insanely difficult challenge Q's that aren't reasonable in the time limit until much later in the learning curve. Then there's stupidly easy stuff that either literally gives the answer within the question or is so basic it's nearly impossible to fail. Can't give feedback on individual challenges though, so just have to avoid the whole mode or tolerate the garbage. Sucks as it would be a great mode if it could adjust difficulty and questions were curated properly to fit difficulty levels.
19th Nov 2023, 11:57 PM
Tom Shaver
Tom Shaver - avatar