JavaScript Speed Coding Challenge: Programming a Basic Algorithm in 2 Minutes | Learn to Code in JS

Veröffentlicht am: 28 Februar 2023
auf dem Kanal: Quick Hacks Coding
9
0

Learn how to code and solve simple coding problems with me. In this Codingame challenge, I'll show you how to build a program that prints a given character in different patterns depending on the input given. Follow along to enhance your #learntocode and #programming skills with #javascript

Transcript:
Today we're playing Clash of Code, a coding game where you have to beat the algorithm before your competitors do. In this challenge, we'll be programming in JavaScript for the reverse problem. You don't have access to the exact description of what you're supposed to do, but you can see the tests and outcomes, and you're going to try to figure it out. The input we have is '3 4 -' which gives us three rows and four characters in each row. So, we need to write a program that takes the character at the bottom as input, determines the number of rows and characters in each row, and prints the output accordingly.

To start, we'll create a row with the given character and repeat it for the desired number of times. We'll use a for loop and count down from the given height. Then, we'll print the row that we've created using console.log.

It took a while to run the code, but we figured out the problem and solved it successfully. Follow and subscribe to see more!


Auf dieser Seite können Sie das Online-Video JavaScript Speed Coding Challenge: Programming a Basic Algorithm in 2 Minutes | Learn to Code in JS mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Quick Hacks Coding 28 Februar 2023 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 9 Mal angesehen und es wurde von 0 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!