Advertisement
ErolKZ

Untitled

Jul 2nd, 2021
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. function solve(input) {
  2.  
  3.  
  4. let x1 = Number(input[0]);
  5.  
  6. let y1 = Number(input[1]);
  7.  
  8. let x2 = Number(input[2]);
  9.  
  10. let y2 = Number(input[3]);
  11.  
  12. let x = Number(input[4]);
  13.  
  14. let y = Number(input[5]);
  15.  
  16.  
  17. let firstCondition = (x === x1 || x === x2) && (y >= y1 || y <= y2);
  18.  
  19. let secondCondition = (y === y1 || y === y2) && (x >= x1 || x <= x2);
  20.  
  21. // console.log(firstCondition);
  22.  
  23. // console.log(secondCondition);
  24.  
  25. // console.log('x1: ' + x1);
  26. // console.log('y1: ' + y1);
  27. // console.log('x2: ' + x2);
  28. // console.log('y2: ' + y2);
  29. // console.log('x: ' + x);
  30. // console.log('y: ' + y);
  31.  
  32.  
  33. if (firstCondition || secondCondition) {
  34.  
  35. console.log('Border');
  36.  
  37. } else {
  38.  
  39. console.log(`Inside / Outside`);
  40.  
  41. }
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49. }
  50.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement