본문 바로가기
코테/코테withJS

백준 Node.js(자바스크립트) 11328 strfry문제

by 트레일헤드레인저 2021. 9. 23.
SMALL

const fs = require('fs');
const filePath = process.platform === 'linux' ? '/dev/stdin' : './input.txt';
const input = fs.readFileSync(filePath).toString().split("\n");

let num = +input.shift();
strfry();

function strfry() {
  for (let i = 0; i < num; i++) {

    let arr = input[i].split(" ");
    let a = arr[0];
    let b = arr[1].split("").reverse().join("");
    if (a === b) {
      console.log("Possible");
    } else {
      console.log("Impossible");
    }
  }
}

VScode에서는 잘되는데 제출하니 틀렸다고한다.

strfry에 대해서 이해를 못한거같은데 뭔지 모르겠다

 

아시는 분 있으면 알려주세요

LIST