Skip to content

9086. 문자열

🚧 This document is a work in progress! 🚧

This document is currently under construction and will be updated soon.

Solutions

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 };

Explanation