Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve(input) {
- let x1 = Number(input[0]);
- let y1 = Number(input[1]);
- let x2 = Number(input[2]);
- let y2 = Number(input[3]);
- let x = Number(input[4]);
- let y = Number(input[5]);
- let firstCondition = (x === x1 || x === x2) && (y >= y1 || y <= y2);
- let secondCondition = (y === y1 || y === y2) && (x >= x1 || x <= x2);
- // console.log(firstCondition);
- // console.log(secondCondition);
- // console.log('x1: ' + x1);
- // console.log('y1: ' + y1);
- // console.log('x2: ' + x2);
- // console.log('y2: ' + y2);
- // console.log('x: ' + x);
- // console.log('y: ' + y);
- if (firstCondition || secondCondition) {
- console.log('Border');
- } else {
- console.log(`Inside / Outside`);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement