SHARE
TWEET

Untitled

a guest May 21st, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const readline = require('readline')
  2.  
  3. const rl = readline.createInterface({
  4.     input: process.stdin,
  5.     output: process.stdout
  6. })
  7.  
  8.  
  9. const invert = (a, b) => {
  10.  
  11.     a = a + ''
  12.     b = b + ''
  13.  
  14.     a = a.split('').reverse().join('')
  15.     b = b.split('').reverse().join('')
  16.  
  17.     if ( a > b) {
  18.         return a
  19.     } else {
  20.         return b
  21.     }
  22.    
  23. }
  24.  
  25. rl.on('line', input => {
  26.     nr = input.split(' ')
  27.    
  28.     nr1 = nr[0]
  29.     nr2 = nr[1]
  30.  
  31.     console.log(invert(nr1, nr2))
  32.  
  33. })
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top