Updated „instruction“ to be uniform across all data
Browse files
data.json
CHANGED
@@ -1,32 +1,12 @@
|
|
1 |
[
|
2 |
{
|
3 |
-
"instruction": "
|
4 |
-
"input": "Generate Fibonacci sequence up to n=10.",
|
5 |
"output": "function fibonacci(n)\n local fib = {0, 1}\n for i = 3, n do\n fib[i] = fib[i - 1] + fib[i - 2]\n end\n return fib\nend\n\nprint(table.concat(fibonacci(10), ', '))"
|
6 |
},
|
7 |
{
|
8 |
-
"instruction": "
|
9 |
-
"input": "Check if the string 'radar' is a palindrome.",
|
10 |
"output": "def is_palindrome(s):\n return s == s[::-1]\n\nprint(is_palindrome('radar'))"
|
11 |
-
},
|
12 |
-
{
|
13 |
-
"instruction": "Implement a JavaScript function to find the longest substring without repeating characters.",
|
14 |
-
"input": "Find the longest substring without repeating characters in 'abcabcbb'.",
|
15 |
-
"output": "function longestSubstringWithoutRepeating(s) {\n let longest = 0;\n let start = 0;\n let map = new Map();\n \n for (let i = 0; i < s.length; i++) {\n if (map.has(s[i])) {\n start = Math.max(start, map.get(s[i]) + 1);\n }\n map.set(s[i], i);\n longest = Math.max(longest, i - start + 1);\n }\n \n return longest;\n}\n\nconsole.log(longestSubstringWithoutRepeating('abcabcbb'));"
|
16 |
-
},
|
17 |
-
{
|
18 |
-
"instruction": "Write a Lua function that calculates the factorial of a given number.",
|
19 |
-
"input": "Calculate the factorial of 5.",
|
20 |
-
"output": "function factorial(n)\n if n == 0 then\n return 1\n else\n return n * factorial(n - 1)\n end\nend\n\nprint(factorial(5))"
|
21 |
-
},
|
22 |
-
{
|
23 |
-
"instruction": "Write a Python function to find the largest prime factor of a given number.",
|
24 |
-
"input": "Find the largest prime factor of 13195.",
|
25 |
-
"output": "def largest_prime_factor(n):\n i = 2\n while i * i <= n:\n if n % i:\n i += 1\n else:\n n //= i\n return n\n\nprint(largest_prime_factor(13195))"
|
26 |
-
},
|
27 |
-
{
|
28 |
-
"instruction": "Implement a JavaScript function to reverse words in a given string.",
|
29 |
-
"input": "Reverse the words in the string 'Hello World'.",
|
30 |
-
"output": "function reverseWords(str) {\n return str.split(' ').reverse().join(' ');\n}\n\nconsole.log(reverseWords('Hello World'));"
|
31 |
}
|
32 |
]
|
|
|
1 |
[
|
2 |
{
|
3 |
+
"instruction": "You are a Developer and you are tasked to do the task bellow",
|
4 |
+
"input": "Generate LUA Code that generates Fibonacci sequence up to n=10.",
|
5 |
"output": "function fibonacci(n)\n local fib = {0, 1}\n for i = 3, n do\n fib[i] = fib[i - 1] + fib[i - 2]\n end\n return fib\nend\n\nprint(table.concat(fibonacci(10), ', '))"
|
6 |
},
|
7 |
{
|
8 |
+
"instruction": "You are a Developer and you are tasked to do the task bellow",
|
9 |
+
"input": "Check if the string 'radar' is a palindrome using python.",
|
10 |
"output": "def is_palindrome(s):\n return s == s[::-1]\n\nprint(is_palindrome('radar'))"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
}
|
12 |
]
|