DEV Community

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

Posted on

Road to Genius: beginner #7

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.

In this post I'll cover two challenges because the first one is a quick one:

programming challenge 1

The first challenge requires us to figure out R's initial value (☃️). But because this value gets overwritten later in the code, so the initial value doesn't matter. But it must be a boolean to pass our validation criteria, so either true or false are correct.

programming challenge 1 answer

Let's proceed to the next challenge:
programming challenge 2

This one is a bit more exciting. We need to figure out 😈 and ☃️, both identifiers, such that R=11. To find 😈 you need to analyze the for-loop, it contains a variable N which hasn't been declared yet, so 😈 is most likely going to be N. The identifier for ☃️ doesn't matter much, because if you look at the last line of code R=arr.length, the challenge is only interested in the number of items in the array, not what those values actually are. So ☃️ should ideally be N or i.

programming challenge 2 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)