deprecate old projects & reduce CI workload

This commit is contained in:
2023-02-18 16:24:20 -07:00
parent c5002c48bc
commit e1f306a92e
147 changed files with 4 additions and 9 deletions

View File

@@ -0,0 +1 @@
main.py

View File

@@ -0,0 +1,6 @@
-lib kiss
-cp src
--main leet_code.Main
-dce full
--python main.py
-cmd bash test-python.sh

View File

@@ -0,0 +1,17 @@
{
"main": "leet_code.Main",
"name": "leet-code",
"description": "",
"classPath": "src/",
"dependencies": {
"kiss": ""
},
"url": "https://github.com/NQNStudios/kisslang.git",
"contributors": [
"amelia, nat"
],
"version": "0.0.0",
"releasenote": "",
"tags": [],
"license": "LGPL"
}

View File

@@ -0,0 +1,7 @@
package leet_code;
import kiss.Kiss;
import kiss.Prelude;
@:build(kiss.Kiss.build())
class Main {}

View File

@@ -0,0 +1,14 @@
// solution to: https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/
(function :Array<Int> twosum [:Array<Int> numbers target]
(let [di (new Map<Int,Int>)]
(doFor [i num] (enumerate numbers 1)
// (print "$i $num")
(if (di.exists (- target num))
(return [(dictGet di (- target num)) i]))
(dictSet di num i)))
(return null))
(assert (= (.toString [2 3]) (.toString (twosum [1 2 3 4 5 6] 5))))
(assert (= (.toString [1 2]) (.toString (twosum [2 7 11 15] 9))))
(assert (= (.toString [1 3]) (.toString (twosum [2 3 4] 6))))
(assert (= (.toString [1 2]) (.toString (twosum [-1 0] -1))))

View File

@@ -0,0 +1,6 @@
# "python" is supposed to mean Python3 everywhere now, but not in practice
if [ ! -z "$(which python3)" ]; then
python3 main.py
else
python main.py
fi

View File

@@ -0,0 +1,3 @@
#! /bin/bash
haxe build.hxml