Skip to content

31403. A + B - C

🚧 This document is a work in progress! 🚧

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

Solutions

js
const testcases = [
  {
    input: `3
4
5
`,
    output: `2
29
`,
  },
];

function solution(input) {
  const [A, B, C] = input.trim().split('\n');

  const number = Number(A) + Number(B) - Number(C);
  const string = Number(A + B) - Number(C);

  return [number, string].join('\n');
}

export default { testcases, solution };
js
const testcases = [
  {
    input: `3
4
5
`,
    output: `2
29
`,
  },
];

function solution(input) {
  const [A, B, C] = input.trim().split('\n');

  const number = Number(A) + Number(B) - Number(C);
  const string = Number(A + B) - Number(C);

  return [number, string].join('\n');
}

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

const testcases = [
  {
    input: `3
4
5
`,
    output: `2
29
`,
  },
] satisfies Testcases;

function solution(input: Input): Output {
  const [A, B, C] = input.trim().split('\n');

  const number = Number(A) + Number(B) - Number(C);
  const string = Number(A + B) - Number(C);

  return [number, string].join('\n');
}

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

const testcases = [
  {
    input: `3
4
5
`,
    output: `2
29
`,
  },
] satisfies Testcases;

function solution(input: Input): Output {
  const [A, B, C] = input.trim().split('\n');

  const number = Number(A) + Number(B) - Number(C);
  const string = Number(A + B) - Number(C);

  return [number, string].join('\n');
}

module.exports = { testcases, solution };

Explanation