StefiIOE

1.4

Nov 3rd, 2020
874
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 'use strict'
  2.  
  3. var readline = require('readline');
  4. var rl = readline.createInterface({
  5.     input: process.stdin,
  6.     output: process.stdout,
  7.     terminal: false
  8. });
  9.  
  10. rl.question('', (p1) => {
  11.     rl.question('', (p2) => {
  12.         p1 = p1.split(", ")
  13.         p2 = p2.split(", ")
  14.  
  15.         console.log(hasSameBread(p1,p2))
  16.  
  17.         rl.close();
  18.     })
  19. });
  20.  
  21. // DO NOT CHANGE ABOVE THIS LINE!!!!
  22.  
  23. function hasSameBread(bread1, bread2 ) { // Write this function
  24. if(bread1[0] == bread2[0] && bread1[bread1.length-1] == bread2[bread2.length-1]){
  25.     return('true');
  26. }
  27. else{
  28.     return ('false');
  29. }
  30. }
  31.  
  32.  
  33.  
RAW Paste Data