Generates code templates for technical interview questions from json file
node dist/template-generator.js < aplusb.json
{
"method": "aplusb",
"params": [
{
"name": "a",
"desc": "The first integer",
"type": "int"
},
{
"name": "b",
"desc": "The second integer",
"type": "int"
}
],
"return": {
"type": "int",
"desc": "The sum of a and b"
},
"hint": "write your code here, try to do it without arithmetic operators."
}
class Solution {
public:
/*
* param a: The first integer
* param b: The second integer
* return: The sum of a and b
*/
int aplusb(int a, int b) {
// write your code here, try to do it without arithmetic operators.
}
};
int main() {
string data;
std::getline(std::cin, data);
int a = parseInt(data);
std::getline(std::cin, data);
int b = parseInt(data);
Solution solution;
std::cout << defaultEncoder(solution.aplusb(a, b)) << std::endl;
return 0;
}
class Solution:
"""
@param a: The first integer
@param b: The second integer
@return: The sum of a and b
"""
def aplusb(self, a, b):
# write your code here, try to do it without arithmetic operators.
import sys
a = parseInt(sys.stdin.readline())
b = parseInt(sys.stdin.readline())
solution = Solution()
print defaultEncoder(solution.aplusb(a, b))
class Solution {
/*
* param a: The first integer
* param b: The second integer
* return: The sum of a and b
*/
public int aplusb(int a, int b) {
// write your code here, try to do it without arithmetic operators.
}
};
class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int a = parseInt(scanner.nextLine());
int b = parseInt(scanner.nextLine());
Solution solution = new Solution();
String result = defaultEncoder(solution.aplusb(a, b));
System.out.println(result);
}
}
rules
: Language specific configurationstemplates
: main / solution templatesindex.js
: Entry pointdist
: Single-file production ready binary