본문으로 건너뛰기

9086. 문자열

🚧 이 문서는 현재 작업 중입니다! 🚧

이 문서는 현재 작업 중이며, 빠른 시일 내에 업데이트될 예정입니다.

문제 풀이

js
const testcases = [
  {
    input: `3
ACDKJFOWIEGHE
O
AB`,
    output: `AE
OO
AB`,
  },
];

function solution(input) {
  const strings = input.trim().split('\n').splice(1);

  return strings.map(string => string[0] + string[string.length - 1]).join('\n');
}

export default { solution, testcases };
js
const testcases = [
  {
    input: `3
ACDKJFOWIEGHE
O
AB`,
    output: `AE
OO
AB`,
  },
];

function solution(input) {
  const strings = input.trim().split('\n').splice(1);

  return strings.map(string => string[0] + string[string.length - 1]).join('\n');
}

module.exports = { solution, testcases };
ts
import type { Testcases, Input, Output } from 'bananass';

const testcases = [
  {
    input: `3
ACDKJFOWIEGHE
O
AB`,
    output: `AE
OO
AB`,
  },
] satisfies Testcases;

function solution(input: Input): Output {
  const strings = input.trim().split('\n').splice(1);

  return strings.map(string => string[0] + string[string.length - 1]).join('\n');
}

export default { solution, testcases };
ts
import type { Testcases, Input, Output } from 'bananass';

const testcases = [
  {
    input: `3
ACDKJFOWIEGHE
O
AB`,
    output: `AE
OO
AB`,
  },
] satisfies Testcases;

function solution(input: Input): Output {
  const strings = input.trim().split('\n').splice(1);

  return strings.map(string => string[0] + string[string.length - 1]).join('\n');
}

module.exports = { solution, testcases };

해설