diff --git a/apps/problems/Sort-Array/Problem.md b/apps/problems/Sort-Array/Problem.md deleted file mode 100644 index 3cf366b..0000000 --- a/apps/problems/Sort-Array/Problem.md +++ /dev/null @@ -1,26 +0,0 @@ -## Sort Array - -Given an array of integers, sort the array in ascending order. - -For example, - -Input: -``` -[5, 2, 9, 1, 7] -``` - -Output: -``` -[1, 2, 5, 7, 9] -``` - -Input: -``` -[10, 4, 8, 3, 6] -``` - -Output: -``` -[3, 4, 6, 8, 10] -``` - diff --git a/apps/problems/Sort-Array/boilerplate-full/function.cpp b/apps/problems/Sort-Array/boilerplate-full/function.cpp deleted file mode 100644 index e9fa674..0000000 --- a/apps/problems/Sort-Array/boilerplate-full/function.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#include - #include - #include - #include - #include - #include - - ##USER_CODE_HERE## - - int main() { - std::ifstream file("/dev/problems/Sort-Array/tests/inputs/##INPUT_FILE_INDEX##.txt"); - std::vector lines; - std::string line; - while (std::getline(file, line)) lines.push_back(line); - - file.close(); - int size_values; - std::istringstream(lines[0]) >> size_values; - std::vector values(size_values); - if(size_values != 0) { - std::istringstream iss(lines[1]); - for (int i=0; i < size_values; i++) iss >> values[i]; - } - std::list result = sortArray(values); - std::cout << result << std::endl; - return 0; - } - \ No newline at end of file diff --git a/apps/problems/Sort-Array/boilerplate-full/function.java b/apps/problems/Sort-Array/boilerplate-full/function.java deleted file mode 100644 index 425f876..0000000 --- a/apps/problems/Sort-Array/boilerplate-full/function.java +++ /dev/null @@ -1,39 +0,0 @@ - - import java.io.*; - import java.util.*; - - public class Main { - - ##USER_CODE_HERE## - - public static void main(String[] args) { - String filePath = "/dev/problems/Sort-Array/tests/inputs/##INPUT_FILE_INDEX##.txt"; - List lines = readLinesFromFile(filePath); - int size_values = Integer.parseInt(lines.get(0).trim()); - - List values = new ArrayList<>(size_values); - - String[] inputStream = lines.get(1).trim().split("\s+"); - - for (String inputChar : inputStream) { - - values.add(Integer.parseInt(inputChar)); - - } - - List result = sortArray(values); - System.out.println(result); - } - public static List readLinesFromFile(String filePath) { - List lines = new ArrayList<>(); - try (BufferedReader br = new BufferedReader(new FileReader(filePath))) { - String line; - while ((line = br.readLine()) != null) { - lines.add(line); - } - } catch (IOException e) { - e.printStackTrace(); - } - return lines; - } - } \ No newline at end of file diff --git a/apps/problems/Sort-Array/boilerplate-full/function.js b/apps/problems/Sort-Array/boilerplate-full/function.js deleted file mode 100644 index 508e172..0000000 --- a/apps/problems/Sort-Array/boilerplate-full/function.js +++ /dev/null @@ -1,8 +0,0 @@ -##USER_CODE_HERE## - - const input = require('fs').readFileSync('/dev/problems/Sort-Array/tests/inputs/##INPUT_FILE_INDEX##.txt', 'utf8').trim().split('\n').join(' ').split(' '); - const size_values = parseInt(input.shift()); -const values = input.splice(0, size_values).map(Number); - const result = sortArray(values); - console.log(result); - \ No newline at end of file diff --git a/apps/problems/Sort-Array/boilerplate-full/function.py b/apps/problems/Sort-Array/boilerplate-full/function.py deleted file mode 100644 index b73ccf2..0000000 --- a/apps/problems/Sort-Array/boilerplate-full/function.py +++ /dev/null @@ -1,11 +0,0 @@ -##USER_CODE_HERE## - - def main(): - size_values = int(input().strip()) -values = [List[int](x) for x in input().strip().split()] - result = sortArray(values); - print(result); - - if __name__ == "__main__": - main() - \ No newline at end of file diff --git a/apps/problems/Sort-Array/boilerplate-full/function.rs b/apps/problems/Sort-Array/boilerplate-full/function.rs deleted file mode 100644 index 97719fb..0000000 --- a/apps/problems/Sort-Array/boilerplate-full/function.rs +++ /dev/null @@ -1,30 +0,0 @@ -use std::fs::read_to_string; - use std::io::{self}; - use std::str::Lines; - - ##USER_CODE_HERE## - - fn main() -> io::Result<()> { - let input = read_to_string("/dev/problems/Sort-Array/tests/inputs/##INPUT_FILE_INDEX##.txt")?; - let mut lines = input.lines(); - let size_values: usize = lines.next().and_then(|line| line.parse().ok()).unwrap_or(0); - let values: Vec = parse_input(lines, size_values); - let result = sortArray(values); - println!("{}", result); - Ok(()) - } -fn parse_input(mut input: Lines, size_arr: usize) -> Vec { - let arr: Vec = input - .next() - .unwrap_or_default() - .split_whitespace() - .filter_map(|x| x.parse().ok()) - .collect(); - - if size_arr == 0 { - Vec::new() - } else { - arr - } - } - \ No newline at end of file diff --git a/apps/problems/Sort-Array/boilerplate/function.cpp b/apps/problems/Sort-Array/boilerplate/function.cpp deleted file mode 100644 index d97b667..0000000 --- a/apps/problems/Sort-Array/boilerplate/function.cpp +++ /dev/null @@ -1,4 +0,0 @@ -std::vector sortArray(std::vector values) { - // Implementation goes here - return result; -} \ No newline at end of file diff --git a/apps/problems/Sort-Array/boilerplate/function.java b/apps/problems/Sort-Array/boilerplate/function.java deleted file mode 100644 index 0b558b1..0000000 --- a/apps/problems/Sort-Array/boilerplate/function.java +++ /dev/null @@ -1,4 +0,0 @@ -public List sortArray(List values) { - // Implementation goes here - return result; -} \ No newline at end of file diff --git a/apps/problems/Sort-Array/boilerplate/function.js b/apps/problems/Sort-Array/boilerplate/function.js deleted file mode 100644 index 56c38c7..0000000 --- a/apps/problems/Sort-Array/boilerplate/function.js +++ /dev/null @@ -1,4 +0,0 @@ -function sortArray(values) { - // Implementation goes here - return result; -} \ No newline at end of file diff --git a/apps/problems/Sort-Array/boilerplate/function.py b/apps/problems/Sort-Array/boilerplate/function.py deleted file mode 100644 index 81391bd..0000000 --- a/apps/problems/Sort-Array/boilerplate/function.py +++ /dev/null @@ -1,3 +0,0 @@ -def sortArray(values: List[int]) -> List[int]: - # Implementation goes here - return result \ No newline at end of file diff --git a/apps/problems/Sort-Array/boilerplate/function.rs b/apps/problems/Sort-Array/boilerplate/function.rs deleted file mode 100644 index a363e1e..0000000 --- a/apps/problems/Sort-Array/boilerplate/function.rs +++ /dev/null @@ -1,4 +0,0 @@ -fn sortArray(values: Vec) -> Vec { - // Implementation goes here - return result; -} \ No newline at end of file diff --git a/apps/problems/Sort-Array/template.md b/apps/problems/Sort-Array/template.md deleted file mode 100644 index a36f3f8..0000000 --- a/apps/problems/Sort-Array/template.md +++ /dev/null @@ -1,6 +0,0 @@ -Problem Name: "Sort Array" -Function Name: sortArray -Input Structure: -Input Field: list values -Output Structure: -Output Field: list sortedValues \ No newline at end of file diff --git a/apps/problems/Sort-Array/tests/inputs/0.txt b/apps/problems/Sort-Array/tests/inputs/0.txt deleted file mode 100644 index d858716..0000000 --- a/apps/problems/Sort-Array/tests/inputs/0.txt +++ /dev/null @@ -1,2 +0,0 @@ -8 -3 1 4 1 5 9 2 6 \ No newline at end of file diff --git a/apps/problems/Sort-Array/tests/inputs/1.txt b/apps/problems/Sort-Array/tests/inputs/1.txt deleted file mode 100644 index e69de29..0000000 diff --git a/apps/problems/Sort-Array/tests/inputs/2.txt b/apps/problems/Sort-Array/tests/inputs/2.txt deleted file mode 100644 index 6ee48b2..0000000 --- a/apps/problems/Sort-Array/tests/inputs/2.txt +++ /dev/null @@ -1,3 +0,0 @@ -5 - --3 -1 -4 -2 -5 \ No newline at end of file diff --git a/apps/problems/Sort-Array/tests/inputs/3.txt b/apps/problems/Sort-Array/tests/inputs/3.txt deleted file mode 100644 index be4a919..0000000 --- a/apps/problems/Sort-Array/tests/inputs/3.txt +++ /dev/null @@ -1,2 +0,0 @@ -6 -5 3 3 2 2 1 \ No newline at end of file diff --git a/apps/problems/Sort-Array/tests/inputs/4.txt b/apps/problems/Sort-Array/tests/inputs/4.txt deleted file mode 100644 index 29b5716..0000000 --- a/apps/problems/Sort-Array/tests/inputs/4.txt +++ /dev/null @@ -1,2 +0,0 @@ -5 -4 4 4 4 4 \ No newline at end of file diff --git a/apps/problems/Sort-Array/tests/inputs/5.txt b/apps/problems/Sort-Array/tests/inputs/5.txt deleted file mode 100644 index b3cd580..0000000 --- a/apps/problems/Sort-Array/tests/inputs/5.txt +++ /dev/null @@ -1,2 +0,0 @@ -5 -10 -2 0 3 -5 \ No newline at end of file diff --git a/apps/problems/Sort-Array/tests/inputs/6.txt b/apps/problems/Sort-Array/tests/inputs/6.txt deleted file mode 100644 index 0bc999a..0000000 --- a/apps/problems/Sort-Array/tests/inputs/6.txt +++ /dev/null @@ -1,2 +0,0 @@ -1 -1 \ No newline at end of file diff --git a/apps/problems/Sort-Array/tests/outputs/0.txt b/apps/problems/Sort-Array/tests/outputs/0.txt deleted file mode 100644 index b2b36ec..0000000 --- a/apps/problems/Sort-Array/tests/outputs/0.txt +++ /dev/null @@ -1 +0,0 @@ -1 1 2 3 4 5 6 9 \ No newline at end of file diff --git a/apps/problems/Sort-Array/tests/outputs/1.txt b/apps/problems/Sort-Array/tests/outputs/1.txt deleted file mode 100644 index e69de29..0000000 diff --git a/apps/problems/Sort-Array/tests/outputs/2.txt b/apps/problems/Sort-Array/tests/outputs/2.txt deleted file mode 100644 index b102480..0000000 --- a/apps/problems/Sort-Array/tests/outputs/2.txt +++ /dev/null @@ -1 +0,0 @@ --5 -4 -3 -2 -1 \ No newline at end of file diff --git a/apps/problems/Sort-Array/tests/outputs/3.txt b/apps/problems/Sort-Array/tests/outputs/3.txt deleted file mode 100644 index abe1e05..0000000 --- a/apps/problems/Sort-Array/tests/outputs/3.txt +++ /dev/null @@ -1 +0,0 @@ -1 2 2 3 3 5 \ No newline at end of file diff --git a/apps/problems/Sort-Array/tests/outputs/4.txt b/apps/problems/Sort-Array/tests/outputs/4.txt deleted file mode 100644 index 6055df3..0000000 --- a/apps/problems/Sort-Array/tests/outputs/4.txt +++ /dev/null @@ -1 +0,0 @@ -4 4 4 4 4 \ No newline at end of file diff --git a/apps/problems/Sort-Array/tests/outputs/5.txt b/apps/problems/Sort-Array/tests/outputs/5.txt deleted file mode 100644 index b56dfe7..0000000 --- a/apps/problems/Sort-Array/tests/outputs/5.txt +++ /dev/null @@ -1 +0,0 @@ --5 -2 0 3 10 \ No newline at end of file diff --git a/apps/problems/Sort-Array/tests/outputs/6.txt b/apps/problems/Sort-Array/tests/outputs/6.txt deleted file mode 100644 index 56a6051..0000000 --- a/apps/problems/Sort-Array/tests/outputs/6.txt +++ /dev/null @@ -1 +0,0 @@ -1 \ No newline at end of file diff --git a/k8s/1-mount-problems/deployment.yml b/k8s/1-mount-problems/deployment.yml index 42e10ad..77aa7d2 100644 --- a/k8s/1-mount-problems/deployment.yml +++ b/k8s/1-mount-problems/deployment.yml @@ -24,6 +24,9 @@ spec: - name: main-container image: busybox command: ['sh', '-c', 'sleep infinity'] + volumeMounts: + - name: problems + mountPath: /problems volumes: - name: problems persistentVolumeClaim: diff --git a/k8s/3-judge0/judge0.yml b/k8s/3-judge0/judge0.yml index 7ba14f7..a0b9a68 100644 --- a/k8s/3-judge0/judge0.yml +++ b/k8s/3-judge0/judge0.yml @@ -20,12 +20,6 @@ spec: image: judge0/judge0:1.13.1 ports: - containerPort: 2358 - volumeMounts: - - name: problems-volume - mountPath: /dev/problems - - name: config-volume - mountPath: /judge0.conf - subPath: judge0.conf env: - name: REDIS_PASSWORD value: "supersecurepassword" @@ -48,8 +42,14 @@ spec: limits: cpu: "500m" memory: "500Mi" + volumeMounts: + - name: problems + mountPath: /dev/problems + - name: config-volume + mountPath: /judge0.conf + subPath: judge0.conf volumes: - - name: problems-volume + - name: problems persistentVolumeClaim: claimName: problems-pvc - name: config-volume @@ -94,12 +94,6 @@ spec: - name: judge0-workers image: judge0/judge0:1.13.1 command: ["./scripts/workers"] - volumeMounts: - - name: problems-volume - mountPath: /dev/problems - - name: config-volume - mountPath: /judge0.conf - subPath: judge0.conf env: - name: REDIS_PASSWORD value: "supersecurepassword" @@ -122,8 +116,14 @@ spec: limits: cpu: "200m" memory: "500Mi" + volumeMounts: + - name: problems + mountPath: /dev/problems + - name: config-volume + mountPath: /judge0.conf + subPath: judge0.conf volumes: - - name: problems-volume + - name: problems persistentVolumeClaim: claimName: problems-pvc - name: config-volume diff --git a/k8s/5-web/deployment.yml b/k8s/5-web/deployment.yml index 3c3667f..b9b8873 100644 --- a/k8s/5-web/deployment.yml +++ b/k8s/5-web/deployment.yml @@ -18,9 +18,6 @@ spec: image: vishal022/algoearth-web:latest ports: - containerPort: 3000 - volumeMounts: - - name: problems - mountPath: /dev/problems env: - name: DATABASE_URL valueFrom: @@ -52,6 +49,9 @@ spec: configMapKeyRef: name: algoearth-web-config key: NEXTAUTH_URL + volumeMounts: + - name: problems + mountPath: /problems volumes: - name: problems persistentVolumeClaim: