1
1
mirror of https://github.com/theoludwig/programming-challenges.git synced 2025-05-18 12:02:53 +02:00

🎉 Initial commit

This commit is contained in:
Divlo
2020-07-05 15:48:51 +02:00
commit 395ae0eff3
32 changed files with 1752 additions and 0 deletions

View File

@ -0,0 +1,17 @@
[
{
"name": "Python",
"extension": ".py",
"launch": "python"
},
{
"name": "JavaScript",
"extension": ".js",
"launch": "node"
},
{
"name": "TypeScript",
"extension": ".ts",
"launch": "ts-node"
}
]

View File

@ -0,0 +1,16 @@
const path = require('path')
const fs = require('fs').promises
const solution = require('./solution')
const inputPath = path.join(__dirname, 'input.json')
const outputPath = path.join(__dirname, 'output.json')
const main = async () => {
const inputFile = await fs.readFile(inputPath)
const inputJSON = JSON.parse(inputFile)
const result = solution.apply(null, inputJSON)
await fs.writeFile(outputPath, JSON.stringify(result))
}
main()

View File

@ -0,0 +1,13 @@
import os
import json
from solution import solution
current_directory = os.path.dirname(__file__)
input_path = os.path.join(current_directory, "input.json")
output_path = os.path.join(current_directory, "output.json")
with open(input_path, "r") as file_content:
input_json = json.load(file_content)
with open(output_path, "w") as file_content:
json.dump(solution(*input_json), file_content)

View File

@ -0,0 +1,18 @@
import path from 'path'
import * as fsWithCallbacks from 'fs'
// @ts-ignore
import solution from './solution'
const fs = fsWithCallbacks.promises
const inputPath = path.join(__dirname, 'input.json')
const outputPath = path.join(__dirname, 'output.json')
const main = async () => {
const inputFile = await fs.readFile(inputPath)
const inputJSON = JSON.parse(inputFile.toString())
const result = solution.apply(null, inputJSON)
await fs.writeFile(outputPath, JSON.stringify(result))
}
main()

View File

@ -0,0 +1,5 @@
function solution () {
}
module.exports = solution

View File

@ -0,0 +1,2 @@
def solution():
pass

View File

@ -0,0 +1,5 @@
function solution () {
}
export default solution