## DEV Community 👩‍💻👨‍💻 is a community of 966,155 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Ilya Nevolin

Posted on

Each day I solve several coding 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, and you will learn a ton of new and interesting things as you go.

``````function cross(a, b) {
return [a[1] * b[2] - a[2] * b[1], a[2] * 💚[0] - a[0] * b[2], a[0] * b[🐼] - a[1] * b[0]];
}
let out = cross([6, 🍎, 2], [8, 2, 6]);
let 💎 = out[0];
A = Math.abs(A);

// 💎 = ? (identifier)
// 🍎 = ? (number)
// 🐼 = ? (number)
// 💚 = ? (identifier)
// such that A = 8 (number)
``````

Today's challenge is, wait... we've encountered similar code before in episode 31 (https://dev.to/codr/road-to-genius-advanced-31-7hh). It's again the `cross` production function but with different bugs to fix this time.

We've learned about the symmetry of this function, so we know that 💚 is `b` and 🐼 is 1. Bug 💎 should be `A`.

We are only left with bug 🍎 which we have to figure out.

We know that `A = out[0]`, the first element of the output is defined by the following formula:

``````a[1] * b[2] - a[2] * b[1]
``````

If we replace these by the numbers we get:

``````🍎 * 6 - 2 * 2
``````

The challenge states that `A = 8` so we have to solve for 🍎:

``````🍎 * 6 - 2 * 2 = 8
🍎 = (8 + 4)/6
🍎 = 2
``````

By solving these challenges you train yourself to be a better programmer. You'll learn newer and better ways of analyzing, debugging and improving code. As a result you'll be more productive and valuable in business. Get started and become a certified Codr today at https://nevolin.be/codr/