remove starter code templates for all questions in CodeChallenge component
This commit is contained in:
@@ -206,15 +206,7 @@ const CodeChallenge = () => {
|
|||||||
output: "[0,1]"
|
output: "[0,1]"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
starterCode: `/**
|
starterCode: ``
|
||||||
* @param {number[]} nums
|
|
||||||
* @param {number} target
|
|
||||||
* @return {number[]}
|
|
||||||
*/
|
|
||||||
var twoSum = function(nums, target) {
|
|
||||||
// Write your solution here
|
|
||||||
|
|
||||||
};`
|
|
||||||
},
|
},
|
||||||
"Q.2": {
|
"Q.2": {
|
||||||
id: "palindrome-number",
|
id: "palindrome-number",
|
||||||
@@ -231,14 +223,7 @@ var twoSum = function(nums, target) {
|
|||||||
explanation: "From left to right, it reads -121. From right to left, it reads 121-. Therefore it is not a palindrome."
|
explanation: "From left to right, it reads -121. From right to left, it reads 121-. Therefore it is not a palindrome."
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
starterCode: `/**
|
starterCode: ``
|
||||||
* @param {number} x
|
|
||||||
* @return {boolean}
|
|
||||||
*/
|
|
||||||
var isPalindrome = function(x) {
|
|
||||||
// Write your solution here
|
|
||||||
|
|
||||||
};`
|
|
||||||
},
|
},
|
||||||
"Q.3": {
|
"Q.3": {
|
||||||
id: "valid-parentheses",
|
id: "valid-parentheses",
|
||||||
@@ -259,14 +244,7 @@ var isPalindrome = function(x) {
|
|||||||
output: "false"
|
output: "false"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
starterCode: `/**
|
starterCode: ``
|
||||||
* @param {string} s
|
|
||||||
* @return {boolean}
|
|
||||||
*/
|
|
||||||
var isValid = function(s) {
|
|
||||||
// Write your solution here
|
|
||||||
|
|
||||||
};`
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -275,43 +253,10 @@ var isValid = function(s) {
|
|||||||
// Language-specific starter code templates
|
// Language-specific starter code templates
|
||||||
const templates = {
|
const templates = {
|
||||||
'JavaScript': problem.starterCode,
|
'JavaScript': problem.starterCode,
|
||||||
'C': `#include <stdio.h>
|
'C': ``,
|
||||||
#include <stdlib.h>
|
'Python': ``,
|
||||||
#include <stdbool.h>
|
'Java': ``,
|
||||||
|
'C++': ``
|
||||||
// ${problem.title} solution
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
// Write your solution here
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}`,
|
|
||||||
'Python': `# ${problem.title}
|
|
||||||
def solution():
|
|
||||||
# Write your solution here
|
|
||||||
# Use input() for user input in Python
|
|
||||||
# Example: name = input("Enter your name: ")
|
|
||||||
pass
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
solution()`,
|
|
||||||
'Java': `public class Solution {
|
|
||||||
// ${problem.title}
|
|
||||||
public static void main(String[] args) {
|
|
||||||
// Write your solution here
|
|
||||||
|
|
||||||
}
|
|
||||||
}`,
|
|
||||||
'C++': `#include <iostream>
|
|
||||||
#include <vector>
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
// ${problem.title} solution
|
|
||||||
int main() {
|
|
||||||
// Write your solution here
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}`
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return templates[lang] || problem.starterCode;
|
return templates[lang] || problem.starterCode;
|
||||||
|
|||||||
Reference in New Issue
Block a user