PROBLEM 48
Medium

Are Numbers Equal?

Programming Basics · JavaScript

</>
STATUS Not solved

TASK

Problem

#48

Given two integers, print `EQUAL` if they are equal, otherwise `NOT EQUAL`.

EXAMPLE

Example

Input
7 7
Output
EQUAL

LIMITS

Constraints

The input sequence contains at most 100000 elements; numeric values fit in JavaScript `Number`.
📖
LEARN Theory for this problem
+

### Are Numbers Equal?

`if / else if / else` chooses a branch from boolean conditions. Comparisons such as `<`, `>=`, `===` and logical operators `&&`, `||`, `!` combine the exact rules that decide which output is valid.

💡
NEED HELP? Hints
+

['Translate every case from the statement into a boolean condition before writing branches.', 'Check values exactly on the condition boundary: `=`, `<`, and `>` must match the statement without an off-by-one shift.']

ANSWER Solution
+
const fs = require('fs');
const input = fs.readFileSync(0, 'utf8').trimEnd();
let [a, b] = input.trim().split(/\s+/).filter(Boolean).map(Number);
if ((a) === (b)) {
    console.log("EQUAL");
} else {
    console.log("NOT EQUAL");
}