DEV Community

Cover image for Road to Genius: beginner #8
Ilya Nevolin
Ilya Nevolin

Posted on

Road to Genius: beginner #8

Each day I solve several challenges and puzzles from Codr's ranked mode. The goal is to reach genius rank, along the way I explain how I solve them. You do not need any programming background to get started, but you will learn a ton of new and interesting things as you go.

programming challenge

In this challenge we have to fix two bugs (๐Ÿผ and ๐Ÿ’ง). The first line of code creates an array of numbers, where ๐Ÿ’ง is an unknown, probably a number as well. Then lower down we have a for-loop which goes over each number in the array. It then compares each number with R. If the number is greater than R, then R becomes ๐Ÿผ. In a nutshell, this simple algorithm keeps track of the largest value in the array, and ๐Ÿผ is most likely going to be el.

If you read the last comment, the challenge states that R should be 9. If we look back at our array, we see that number 9 is already present, so it doesn't matter what ๐Ÿ’ง's value should be.

programming challenge answer


If you feel inspired and motivated to upgrade your coding + debugging skills, join me on the Road to Genius at https://nevolin.be/codr/

Top comments (0)