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

Published: 28 February 2023
on channel: 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!


On this page of the site you can watch the video online JavaScript Speed Coding Challenge: Programming a Basic Algorithm in 2 Minutes | Learn to Code in JS with a duration of hours minute second in good quality, which was uploaded by the user Quick Hacks Coding 28 February 2023, share the link with friends and acquaintances, this video has already been watched 9 times on youtube and it was liked by 0 viewers. Enjoy your viewing!