id
int64
0
100M
language
stringclasses
3 values
prog_lang
stringclasses
6 values
category
stringclasses
10 values
difficulty
stringclasses
3 values
instruction
stringlengths
30
86
output
stringlengths
7
192
text
stringlengths
92
300
73,160,195
en
Python
array_ops
intermediate
Write a function that reverses a list in Python.
def reverse_list(arr): return arr[::-1]
### Instruction: Write a function that reverses a list in Python. ### Response: def reverse_list(arr): return arr[::-1]
31,895
en
Java
sum_n
intermediate
Write a function in Java that sums numbers from 1 to 8860.
static int sumToN(int n) { int s = 0; for (int i = 1; i <= n; i++) s += i; return s; } System.out.println(sumToN(8860));
### Instruction: Write a function in Java that sums numbers from 1 to 8860. ### Response: static int sumToN(int n) { int s = 0; for (int i = 1; i <= n; i++) s += i; return s; } System.out.println(sumToN(8860));
1,136,398
ru
Unity
var_decl
beginner
Как объявить переменную y со значением 686368 в Unity?
int y = 686368;
### Instruction: Как объявить переменную y со значением 686368 в Unity? ### Response: int y = 686368;
3,125,082
kk
Unity
var_decl
beginner
Unity тілінде 887305 мәнімен value айнымалысын қалай жариялауға болады?
int value = 887305;
### Instruction: Unity тілінде 887305 мәнімен value айнымалысын қалай жариялауға болады? ### Response: int value = 887305;
4,536,384
en
JavaScript
var_decl
beginner
How to declare a variable x with value 658790 in JavaScript?
let x = 658790;
### Instruction: How to declare a variable x with value 658790 in JavaScript? ### Response: let x = 658790;
67,554,669
ru
C#
array_ops
intermediate
Напишите на C# функцию, которая фильтрует только четные числа из списка.
public System.Collections.Generic.List<int> Filter(int[] arr) { var res = new System.Collections.Generic.List<int>(); foreach(int x in arr) if(x % 2 == 0) res.Add(x); return res; }
### Instruction: Напишите на C# функцию, которая фильтрует только четные числа из списка. ### Response: public System.Collections.Generic.List<int> Filter(int[] arr) { var res = new System.Collections.Generic.List<int>(); foreach(int x in arr) if(x % 2 == 0) res.Add(x); return res; }
990,469
ru
Python
sum_n
intermediate
Напиши функцию на Python, которая считает сумму чисел от 1 до 7259.
def sum_to_n(n): return sum(range(1, n + 1)) print(sum_to_n(7259))
### Instruction: Напиши функцию на Python, которая считает сумму чисел от 1 до 7259. ### Response: def sum_to_n(n): return sum(range(1, n + 1)) print(sum_to_n(7259))
69,813,596
kk
JavaScript
string_ops
intermediate
JavaScript тилінде жолды жоғарғы регистрге ауыстыратын функцияны жазыңыз.
const toUpper = s => s.toUpperCase();
### Instruction: JavaScript тилінде жолды жоғарғы регистрге ауыстыратын функцияны жазыңыз. ### Response: const toUpper = s => s.toUpperCase();
32,484,777
kk
JavaScript
array_ops
advanced
JavaScript тилінде тізімді керісінше айналдыратын функцияны жазыңыз.
const reverseArr = arr => arr.reverse();
### Instruction: JavaScript тилінде тізімді керісінше айналдыратын функцияны жазыңыз. ### Response: const reverseArr = arr => arr.reverse();
3,724,257
ru
Unity
var_decl
beginner
Как объявить переменную score со значением 281848 в Unity?
int score = 281848;
### Instruction: Как объявить переменную score со значением 281848 в Unity? ### Response: int score = 281848;
29,796,585
ru
Python
string_ops
advanced
Напишите на Python функцию, которая переводит строку в верхний регистр.
def to_upper(s): return s.upper()
### Instruction: Напишите на Python функцию, которая переводит строку в верхний регистр. ### Response: def to_upper(s): return s.upper()
70,533,696
ru
JavaScript
string_ops
advanced
Напишите на JavaScript функцию, которая проверяет, является ли строка палиндромом.
const isPalindrome = s => s === s.split('').reverse().join('');
### Instruction: Напишите на JavaScript функцию, которая проверяет, является ли строка палиндромом. ### Response: const isPalindrome = s => s === s.split('').reverse().join('');
55,865,985
kk
C#
string_ops
advanced
C# тилінде жолдың палиндром екенін тексеретін функцияны жазыңыз.
public bool IsPalindrome(string s) { int min = 0, max = s.Length - 1; while (min < max) { if (s[min] != s[max]) return false; min++; max--; } return true; }
### Instruction: C# тилінде жолдың палиндром екенін тексеретін функцияны жазыңыз. ### Response: public bool IsPalindrome(string s) { int min = 0, max = s.Length - 1; while (min < max) { if (s[min] != s[max]) return false; min++; max--; } return true; }
61,501,933
ru
JavaScript
logic_ops
advanced
Напишите на JavaScript логику проверки, является ли год 2079 високосным.
function isLeap() { let y = 2079; return y % 4 === 0 && (y % 100 !== 0 || y % 400 === 0); }
### Instruction: Напишите на JavaScript логику проверки, является ли год 2079 високосным. ### Response: function isLeap() { let y = 2079; return y % 4 === 0 && (y % 100 !== 0 || y % 400 === 0); }
78,554,021
en
Java
logic_ops
advanced
Write logic to check if the year 1967 is a leap year in Java.
public bool IsLeap() { int y = 1967; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
### Instruction: Write logic to check if the year 1967 is a leap year in Java. ### Response: public bool IsLeap() { int y = 1967; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
19,281,463
en
Unity
array_ops
intermediate
Write a function that reverses a list in Unity.
public void Reverse(int[] arr) { System.Array.Reverse(arr); }
### Instruction: Write a function that reverses a list in Unity. ### Response: public void Reverse(int[] arr) { System.Array.Reverse(arr); }
99,487,338
kk
C#
array_ops
advanced
C# тилінде тізімнен тек жұп сандарды сүзетін функцияны жазыңыз.
public System.Collections.Generic.List<int> Filter(int[] arr) { var res = new System.Collections.Generic.List<int>(); foreach(int x in arr) if(x % 2 == 0) res.Add(x); return res; }
### Instruction: C# тилінде тізімнен тек жұп сандарды сүзетін функцияны жазыңыз. ### Response: public System.Collections.Generic.List<int> Filter(int[] arr) { var res = new System.Collections.Generic.List<int>(); foreach(int x in arr) if(x % 2 == 0) res.Add(x); return res; }
25,420,957
ru
Unity
logic_ops
intermediate
Напишите на Unity логику проверки, является ли год 1992 високосным.
public bool IsLeap() { int y = 1992; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
### Instruction: Напишите на Unity логику проверки, является ли год 1992 високосным. ### Response: public bool IsLeap() { int y = 1992; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
3,971,052
kk
Python
var_decl
beginner
Python тілінде 266532 мәнімен buffer айнымалысын қалай жариялауға болады?
buffer = 266532
### Instruction: Python тілінде 266532 мәнімен buffer айнымалысын қалай жариялауға болады? ### Response: buffer = 266532
4,671,859
en
C#
var_decl
beginner
How to declare a variable total with value 726568 in C#?
int total = 726568;
### Instruction: How to declare a variable total with value 726568 in C#? ### Response: int total = 726568;
49,900,794
en
C#
array_ops
advanced
Write a function that filters only even numbers from a list in C#.
public System.Collections.Generic.List<int> Filter(int[] arr) { var res = new System.Collections.Generic.List<int>(); foreach(int x in arr) if(x % 2 == 0) res.Add(x); return res; }
### Instruction: Write a function that filters only even numbers from a list in C#. ### Response: public System.Collections.Generic.List<int> Filter(int[] arr) { var res = new System.Collections.Generic.List<int>(); foreach(int x in arr) if(x % 2 == 0) res.Add(x); return res; }
13,092,176
ru
Unity
logic_ops
advanced
Напишите на Unity логику проверки, является ли год 1950 високосным.
public bool IsLeap() { int y = 1950; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
### Instruction: Напишите на Unity логику проверки, является ли год 1950 високосным. ### Response: public bool IsLeap() { int y = 1950; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
97,331,777
en
Java
logic_ops
advanced
Write logic to check if the year 2017 is a leap year in Java.
public bool IsLeap() { int y = 2017; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
### Instruction: Write logic to check if the year 2017 is a leap year in Java. ### Response: public bool IsLeap() { int y = 2017; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
50,933
en
Java
factorial
advanced
Write a function in Java that calculates the factorial of 7262.
static long factorial(int n) { return n <= 1 ? 1 : n * factorial(n - 1); } System.out.println(factorial(7262));
### Instruction: Write a function in Java that calculates the factorial of 7262. ### Response: static long factorial(int n) { return n <= 1 ? 1 : n * factorial(n - 1); } System.out.println(factorial(7262));
45,390,805
ru
Java
string_ops
intermediate
Напишите на Java функцию, которая проверяет, является ли строка палиндромом.
public bool IsPalindrome(string s) { int min = 0, max = s.Length - 1; while (min < max) { if (s[min] != s[max]) return false; min++; max--; } return true; }
### Instruction: Напишите на Java функцию, которая проверяет, является ли строка палиндромом. ### Response: public bool IsPalindrome(string s) { int min = 0, max = s.Length - 1; while (min < max) { if (s[min] != s[max]) return false; min++; max--; } return true; }
99,266,714
ru
Python
logic_ops
intermediate
Напишите на Python логику проверки, является ли год 1941 високосным.
def is_leap(): year = 1941 return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0)
### Instruction: Напишите на Python логику проверки, является ли год 1941 високосным. ### Response: def is_leap(): year = 1941 return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0)
83,451,829
en
Unity
logic_ops
advanced
Write a function that determines if the number 76 is prime in Unity.
public bool IsPrime() { int n = 76; if (n <= 1) return false; for (int i = 2; i * i <= n; i++) if (n % i == 0) return false; return true; }
### Instruction: Write a function that determines if the number 76 is prime in Unity. ### Response: public bool IsPrime() { int n = 76; if (n <= 1) return false; for (int i = 2; i * i <= n; i++) if (n % i == 0) return false; return true; }
53,504,960
en
JavaScript
array_ops
intermediate
Write a function that filters only even numbers from a list in JavaScript.
const filterEven = arr => arr.filter(x => x % 2 === 0);
### Instruction: Write a function that filters only even numbers from a list in JavaScript. ### Response: const filterEven = arr => arr.filter(x => x % 2 === 0);
2,334,844
kk
C#
var_decl
beginner
C# тілінде 770126 мәнімен total айнымалысын қалай жариялауға болады?
int total = 770126;
### Instruction: C# тілінде 770126 мәнімен total айнымалысын қалай жариялауға болады? ### Response: int total = 770126;
2,592,566
en
Unity
var_decl
beginner
How to declare a variable result with value 982013 in Unity?
int result = 982013;
### Instruction: How to declare a variable result with value 982013 in Unity? ### Response: int result = 982013;
2,665,090
kk
Python
var_decl
beginner
Python тілінде 375711 мәнімен weight айнымалысын қалай жариялауға болады?
weight = 375711
### Instruction: Python тілінде 375711 мәнімен weight айнымалысын қалай жариялауға болады? ### Response: weight = 375711
2,205,979
ru
Unity
var_decl
beginner
Как объявить переменную size со значением 690847 в Unity?
int size = 690847;
### Instruction: Как объявить переменную size со значением 690847 в Unity? ### Response: int size = 690847;
1,701,766
ru
JavaScript
var_decl
beginner
Как объявить переменную index со значением 145794 в JavaScript?
let index = 145794;
### Instruction: Как объявить переменную index со значением 145794 в JavaScript? ### Response: let index = 145794;
56,172,994
kk
JavaScript
array_ops
intermediate
JavaScript тилінде тізімді керісінше айналдыратын функцияны жазыңыз.
const reverseArr = arr => arr.reverse();
### Instruction: JavaScript тилінде тізімді керісінше айналдыратын функцияны жазыңыз. ### Response: const reverseArr = arr => arr.reverse();
95,462,128
ru
Java
string_ops
advanced
Напишите на Java функцию, которая переводит строку в верхний регистр.
public string ToUpper(string s) { return s.ToUpper(); }
### Instruction: Напишите на Java функцию, которая переводит строку в верхний регистр. ### Response: public string ToUpper(string s) { return s.ToUpper(); }
71,249
ru
Python
var_decl
beginner
Как объявить переменную rate со значением 782358 в Python?
rate = 782358
### Instruction: Как объявить переменную rate со значением 782358 в Python? ### Response: rate = 782358
77,002
ru
Unity
factorial
advanced
Напиши функцию на Unity, которая вычисляет факториал числа 8134.
long Factorial(int n) { return n <= 1 ? 1 : n * Factorial(n - 1); } void Start() { Debug.Log(Factorial(8134)); }
### Instruction: Напиши функцию на Unity, которая вычисляет факториал числа 8134. ### Response: long Factorial(int n) { return n <= 1 ? 1 : n * Factorial(n - 1); } void Start() { Debug.Log(Factorial(8134)); }
64,937,779
kk
Unity
logic_ops
advanced
Unity тилінде 407 санының жай сан екенін анықтайтын функцияны жазыңыз.
public bool IsPrime() { int n = 407; if (n <= 1) return false; for (int i = 2; i * i <= n; i++) if (n % i == 0) return false; return true; }
### Instruction: Unity тилінде 407 санының жай сан екенін анықтайтын функцияны жазыңыз. ### Response: public bool IsPrime() { int n = 407; if (n <= 1) return false; for (int i = 2; i * i <= n; i++) if (n % i == 0) return false; return true; }
1,011,462
en
C++
var_decl
beginner
How to declare a variable x with value 753072 in C++?
int x = 753072;
### Instruction: How to declare a variable x with value 753072 in C++? ### Response: int x = 753072;
553,176
ru
Python
factorial
advanced
Напиши функцию на Python, которая вычисляет факториал числа 9327.
def factorial(n): return 1 if n <= 1 else n * factorial(n - 1) print(factorial(9327))
### Instruction: Напиши функцию на Python, которая вычисляет факториал числа 9327. ### Response: def factorial(n): return 1 if n <= 1 else n * factorial(n - 1) print(factorial(9327))
31,400,133
en
Java
logic_ops
advanced
Write logic to check if the year 1956 is a leap year in Java.
public bool IsLeap() { int y = 1956; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
### Instruction: Write logic to check if the year 1956 is a leap year in Java. ### Response: public bool IsLeap() { int y = 1956; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
1,071,456
kk
Java
var_decl
beginner
Java тілінде 985127 мәнімен amount айнымалысын қалай жариялауға болады?
int amount = 985127;
### Instruction: Java тілінде 985127 мәнімен amount айнымалысын қалай жариялауға болады? ### Response: int amount = 985127;
29,980,806
en
C++
logic_ops
intermediate
Write logic to check if the year 2006 is a leap year in C++.
public bool IsLeap() { int y = 2006; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
### Instruction: Write logic to check if the year 2006 is a leap year in C++. ### Response: public bool IsLeap() { int y = 2006; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
92,939,519
ru
JavaScript
string_ops
intermediate
Напишите на JavaScript функцию, которая считает количество гласных букв в тексте.
const countVowels = s => (s.match(/[aeiou]/gi) || []).length;
### Instruction: Напишите на JavaScript функцию, которая считает количество гласных букв в тексте. ### Response: const countVowels = s => (s.match(/[aeiou]/gi) || []).length;
641,987
kk
JavaScript
sum_n
intermediate
JavaScript тілінде 1-ден 3294-ге дейінгі сандардың қосындысын есептейтін функция жаз.
function sumToN(n) { let s = 0; for (let i = 1; i <= n; i++) s += i; return s; } console.log(sumToN(3294));
### Instruction: JavaScript тілінде 1-ден 3294-ге дейінгі сандардың қосындысын есептейтін функция жаз. ### Response: function sumToN(n) { let s = 0; for (let i = 1; i <= n; i++) s += i; return s; } console.log(sumToN(3294));
3,232,367
en
C++
var_decl
beginner
How to declare a variable size with value 696593 in C++?
int size = 696593;
### Instruction: How to declare a variable size with value 696593 in C++? ### Response: int size = 696593;
43,686,148
kk
C++
string_ops
intermediate
C++ тилінде жолды жоғарғы регистрге ауыстыратын функцияны жазыңыз.
public string ToUpper(string s) { return s.ToUpper(); }
### Instruction: C++ тилінде жолды жоғарғы регистрге ауыстыратын функцияны жазыңыз. ### Response: public string ToUpper(string s) { return s.ToUpper(); }
600,056
en
Java
sum_n
intermediate
Write a function in Java that sums numbers from 1 to 9949.
static int sumToN(int n) { int s = 0; for (int i = 1; i <= n; i++) s += i; return s; } System.out.println(sumToN(9949));
### Instruction: Write a function in Java that sums numbers from 1 to 9949. ### Response: static int sumToN(int n) { int s = 0; for (int i = 1; i <= n; i++) s += i; return s; } System.out.println(sumToN(9949));
3,975,745
kk
Java
var_decl
beginner
Java тілінде 66417 мәнімен amount айнымалысын қалай жариялауға болады?
int amount = 66417;
### Instruction: Java тілінде 66417 мәнімен amount айнымалысын қалай жариялауға болады? ### Response: int amount = 66417;
88,566,556
kk
Unity
string_ops
advanced
Unity тилінде мәтіндегі дауысты әріптердің санын есептейтін функцияны жазыңыз.
public int CountVowels(string s) { int c = 0; foreach(char ch in s.ToLower()) if("aeiou".Contains(ch)) c++; return c; }
### Instruction: Unity тилінде мәтіндегі дауысты әріптердің санын есептейтін функцияны жазыңыз. ### Response: public int CountVowels(string s) { int c = 0; foreach(char ch in s.ToLower()) if("aeiou".Contains(ch)) c++; return c; }
68,405,424
ru
Python
array_ops
advanced
Напишите на Python функцию, которая фильтрует только четные числа из списка.
def filter_even(arr): return [x for x in arr if x % 2 == 0]
### Instruction: Напишите на Python функцию, которая фильтрует только четные числа из списка. ### Response: def filter_even(arr): return [x for x in arr if x % 2 == 0]
32,756,747
kk
Python
logic_ops
intermediate
Python тилінде 2063 жылы кібісе жыл екенін тексеретін логиканы жазыңыз.
def is_leap(): year = 2063 return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0)
### Instruction: Python тилінде 2063 жылы кібісе жыл екенін тексеретін логиканы жазыңыз. ### Response: def is_leap(): year = 2063 return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0)
70,846,868
ru
C++
logic_ops
intermediate
Напишите на C++ функцию, определяющую, является ли число 28 простым.
public bool IsPrime() { int n = 28; if (n <= 1) return false; for (int i = 2; i * i <= n; i++) if (n % i == 0) return false; return true; }
### Instruction: Напишите на C++ функцию, определяющую, является ли число 28 простым. ### Response: public bool IsPrime() { int n = 28; if (n <= 1) return false; for (int i = 2; i * i <= n; i++) if (n % i == 0) return false; return true; }
87,359,038
kk
Unity
array_ops
advanced
Unity тилінде жиымдағы ең үлкен санды табатын функцияны жазыңыз.
public int GetMax(int[] arr) { int max = arr[0]; foreach(int x in arr) if(x > max) max = x; return max; }
### Instruction: Unity тилінде жиымдағы ең үлкен санды табатын функцияны жазыңыз. ### Response: public int GetMax(int[] arr) { int max = arr[0]; foreach(int x in arr) if(x > max) max = x; return max; }
3,551,415
kk
JavaScript
var_decl
beginner
JavaScript тілінде 309265 мәнімен level айнымалысын қалай жариялауға болады?
let level = 309265;
### Instruction: JavaScript тілінде 309265 мәнімен level айнымалысын қалай жариялауға болады? ### Response: let level = 309265;
54,115,245
en
C++
string_ops
advanced
Write a function that counts vowels in a text in C++.
public int CountVowels(string s) { int c = 0; foreach(char ch in s.ToLower()) if("aeiou".Contains(ch)) c++; return c; }
### Instruction: Write a function that counts vowels in a text in C++. ### Response: public int CountVowels(string s) { int c = 0; foreach(char ch in s.ToLower()) if("aeiou".Contains(ch)) c++; return c; }
24,354,490
ru
C#
string_ops
advanced
Напишите на C# функцию, которая считает количество гласных букв в тексте.
public int CountVowels(string s) { int c = 0; foreach(char ch in s.ToLower()) if("aeiou".Contains(ch)) c++; return c; }
### Instruction: Напишите на C# функцию, которая считает количество гласных букв в тексте. ### Response: public int CountVowels(string s) { int c = 0; foreach(char ch in s.ToLower()) if("aeiou".Contains(ch)) c++; return c; }
32,530,638
kk
Python
logic_ops
advanced
Python тилінде 263 санының жай сан екенін анықтайтын функцияны жазыңыз.
def is_prime(): n = 263 return n > 1 and all(n % i != 0 for i in range(2, int(n**0.5) + 1))
### Instruction: Python тилінде 263 санының жай сан екенін анықтайтын функцияны жазыңыз. ### Response: def is_prime(): n = 263 return n > 1 and all(n % i != 0 for i in range(2, int(n**0.5) + 1))
89,602,367
ru
JavaScript
logic_ops
intermediate
Напишите на JavaScript логику проверки, является ли год 2081 високосным.
function isLeap() { let y = 2081; return y % 4 === 0 && (y % 100 !== 0 || y % 400 === 0); }
### Instruction: Напишите на JavaScript логику проверки, является ли год 2081 високосным. ### Response: function isLeap() { let y = 2081; return y % 4 === 0 && (y % 100 !== 0 || y % 400 === 0); }
86,610,474
en
C#
string_ops
intermediate
Write a function that checks if a string is a palindrome in C#.
public bool IsPalindrome(string s) { int min = 0, max = s.Length - 1; while (min < max) { if (s[min] != s[max]) return false; min++; max--; } return true; }
### Instruction: Write a function that checks if a string is a palindrome in C#. ### Response: public bool IsPalindrome(string s) { int min = 0, max = s.Length - 1; while (min < max) { if (s[min] != s[max]) return false; min++; max--; } return true; }
188,286
ru
C++
sum_n
intermediate
Напиши функцию на C++, которая считает сумму чисел от 1 до 4786.
int sum_to_n(int n) { int s = 0; for (int i = 1; i <= n; i++) s += i; return s; } std::cout << sum_to_n(4786) << std::endl;
### Instruction: Напиши функцию на C++, которая считает сумму чисел от 1 до 4786. ### Response: int sum_to_n(int n) { int s = 0; for (int i = 1; i <= n; i++) s += i; return s; } std::cout << sum_to_n(4786) << std::endl;
12,364,416
en
Python
array_ops
intermediate
Write a function that reverses a list in Python.
def reverse_list(arr): return arr[::-1]
### Instruction: Write a function that reverses a list in Python. ### Response: def reverse_list(arr): return arr[::-1]
1,942,369
kk
Unity
var_decl
beginner
Unity тілінде 798991 мәнімен timer айнымалысын қалай жариялауға болады?
int timer = 798991;
### Instruction: Unity тілінде 798991 мәнімен timer айнымалысын қалай жариялауға болады? ### Response: int timer = 798991;
87,001,179
ru
C#
array_ops
advanced
Напишите на C# функцию, которая фильтрует только четные числа из списка.
public System.Collections.Generic.List<int> Filter(int[] arr) { var res = new System.Collections.Generic.List<int>(); foreach(int x in arr) if(x % 2 == 0) res.Add(x); return res; }
### Instruction: Напишите на C# функцию, которая фильтрует только четные числа из списка. ### Response: public System.Collections.Generic.List<int> Filter(int[] arr) { var res = new System.Collections.Generic.List<int>(); foreach(int x in arr) if(x % 2 == 0) res.Add(x); return res; }
134,190
kk
JavaScript
factorial
advanced
JavaScript тілінде 6478 санының факториалын есептейтін функция жаз.
function factorial(n) { return n <= 1 ? 1 : n * factorial(n - 1); } console.log(factorial(6478));
### Instruction: JavaScript тілінде 6478 санының факториалын есептейтін функция жаз. ### Response: function factorial(n) { return n <= 1 ? 1 : n * factorial(n - 1); } console.log(factorial(6478));
98,707,344
ru
Python
string_ops
advanced
Напишите на Python функцию, которая переводит строку в верхний регистр.
def to_upper(s): return s.upper()
### Instruction: Напишите на Python функцию, которая переводит строку в верхний регистр. ### Response: def to_upper(s): return s.upper()
68,996,636
ru
C#
logic_ops
intermediate
Напишите на C# логику проверки, является ли год 2067 високосным.
public bool IsLeap() { int y = 2067; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
### Instruction: Напишите на C# логику проверки, является ли год 2067 високосным. ### Response: public bool IsLeap() { int y = 2067; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
2,482,163
en
Java
var_decl
beginner
How to declare a variable index with value 295364 in Java?
int index = 295364;
### Instruction: How to declare a variable index with value 295364 in Java? ### Response: int index = 295364;
154,192
en
C++
factorial
advanced
Write a function in C++ that calculates the factorial of 4861.
long long factorial(int n) { return n <= 1 ? 1 : n * factorial(n - 1); } std::cout << factorial(4861) << std::endl;
### Instruction: Write a function in C++ that calculates the factorial of 4861. ### Response: long long factorial(int n) { return n <= 1 ? 1 : n * factorial(n - 1); } std::cout << factorial(4861) << std::endl;
40,973,558
en
JavaScript
logic_ops
intermediate
Write a function that determines if the number 483 is prime in JavaScript.
function isPrime() { let n = 483; if (n <= 1) return false; for (let i = 2; i * i <= n; i++) if (n % i === 0) return false; return true; }
### Instruction: Write a function that determines if the number 483 is prime in JavaScript. ### Response: function isPrime() { let n = 483; if (n <= 1) return false; for (let i = 2; i * i <= n; i++) if (n % i === 0) return false; return true; }
68,638,589
kk
Python
array_ops
intermediate
Python тилінде жиымдағы ең үлкен санды табатын функцияны жазыңыз.
def get_max(arr): return max(arr)
### Instruction: Python тилінде жиымдағы ең үлкен санды табатын функцияны жазыңыз. ### Response: def get_max(arr): return max(arr)
59,715,202
kk
Unity
string_ops
advanced
Unity тилінде жолдың палиндром екенін тексеретін функцияны жазыңыз.
public bool IsPalindrome(string s) { int min = 0, max = s.Length - 1; while (min < max) { if (s[min] != s[max]) return false; min++; max--; } return true; }
### Instruction: Unity тилінде жолдың палиндром екенін тексеретін функцияны жазыңыз. ### Response: public bool IsPalindrome(string s) { int min = 0, max = s.Length - 1; while (min < max) { if (s[min] != s[max]) return false; min++; max--; } return true; }
55,119,468
ru
Unity
array_ops
advanced
Напишите на Unity функцию, которая разворачивает список задом наперед.
public void Reverse(int[] arr) { System.Array.Reverse(arr); }
### Instruction: Напишите на Unity функцию, которая разворачивает список задом наперед. ### Response: public void Reverse(int[] arr) { System.Array.Reverse(arr); }
23,240,135
kk
Python
array_ops
intermediate
Python тилінде тізімді керісінше айналдыратын функцияны жазыңыз.
def reverse_list(arr): return arr[::-1]
### Instruction: Python тилінде тізімді керісінше айналдыратын функцияны жазыңыз. ### Response: def reverse_list(arr): return arr[::-1]
3,618,023
ru
C++
var_decl
beginner
Как объявить переменную amount со значением 453035 в C++?
int amount = 453035;
### Instruction: Как объявить переменную amount со значением 453035 в C++? ### Response: int amount = 453035;
70,521,156
kk
JavaScript
array_ops
advanced
JavaScript тилінде жиымдағы ең үлкен санды табатын функцияны жазыңыз.
const getMax = arr => Math.max(...arr);
### Instruction: JavaScript тилінде жиымдағы ең үлкен санды табатын функцияны жазыңыз. ### Response: const getMax = arr => Math.max(...arr);
2,879,919
ru
Unity
var_decl
beginner
Как объявить переменную total со значением 14548 в Unity?
int total = 14548;
### Instruction: Как объявить переменную total со значением 14548 в Unity? ### Response: int total = 14548;
68,617,577
kk
JavaScript
string_ops
intermediate
JavaScript тилінде жолды жоғарғы регистрге ауыстыратын функцияны жазыңыз.
const toUpper = s => s.toUpperCase();
### Instruction: JavaScript тилінде жолды жоғарғы регистрге ауыстыратын функцияны жазыңыз. ### Response: const toUpper = s => s.toUpperCase();
4,104,413
en
C++
var_decl
beginner
How to declare a variable amount with value 533541 in C++?
int amount = 533541;
### Instruction: How to declare a variable amount with value 533541 in C++? ### Response: int amount = 533541;
997,675
kk
C++
var_decl
beginner
C++ тілінде 254517 мәнімен buffer айнымалысын қалай жариялауға болады?
int buffer = 254517;
### Instruction: C++ тілінде 254517 мәнімен buffer айнымалысын қалай жариялауға болады? ### Response: int buffer = 254517;
15,411,962
en
C#
logic_ops
advanced
Write logic to check if the year 1978 is a leap year in C#.
public bool IsLeap() { int y = 1978; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
### Instruction: Write logic to check if the year 1978 is a leap year in C#. ### Response: public bool IsLeap() { int y = 1978; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
384,472
kk
Java
factorial
advanced
Java тілінде 3292 санының факториалын есептейтін функция жаз.
static long factorial(int n) { return n <= 1 ? 1 : n * factorial(n - 1); } System.out.println(factorial(3292));
### Instruction: Java тілінде 3292 санының факториалын есептейтін функция жаз. ### Response: static long factorial(int n) { return n <= 1 ? 1 : n * factorial(n - 1); } System.out.println(factorial(3292));
60,946,932
kk
Python
logic_ops
intermediate
Python тилінде 307 санының жай сан екенін анықтайтын функцияны жазыңыз.
def is_prime(): n = 307 return n > 1 and all(n % i != 0 for i in range(2, int(n**0.5) + 1))
### Instruction: Python тилінде 307 санының жай сан екенін анықтайтын функцияны жазыңыз. ### Response: def is_prime(): n = 307 return n > 1 and all(n % i != 0 for i in range(2, int(n**0.5) + 1))
29,655,998
en
JavaScript
logic_ops
advanced
Write logic to check if the year 2060 is a leap year in JavaScript.
function isLeap() { let y = 2060; return y % 4 === 0 && (y % 100 !== 0 || y % 400 === 0); }
### Instruction: Write logic to check if the year 2060 is a leap year in JavaScript. ### Response: function isLeap() { let y = 2060; return y % 4 === 0 && (y % 100 !== 0 || y % 400 === 0); }
54,767,592
en
Java
array_ops
advanced
Write a function that filters only even numbers from a list in Java.
public System.Collections.Generic.List<int> Filter(int[] arr) { var res = new System.Collections.Generic.List<int>(); foreach(int x in arr) if(x % 2 == 0) res.Add(x); return res; }
### Instruction: Write a function that filters only even numbers from a list in Java. ### Response: public System.Collections.Generic.List<int> Filter(int[] arr) { var res = new System.Collections.Generic.List<int>(); foreach(int x in arr) if(x % 2 == 0) res.Add(x); return res; }
2,343,588
en
Java
var_decl
beginner
How to declare a variable rate with value 518153 in Java?
int rate = 518153;
### Instruction: How to declare a variable rate with value 518153 in Java? ### Response: int rate = 518153;
2,536,648
kk
C#
var_decl
beginner
C# тілінде 241471 мәнімен speed айнымалысын қалай жариялауға болады?
int speed = 241471;
### Instruction: C# тілінде 241471 мәнімен speed айнымалысын қалай жариялауға болады? ### Response: int speed = 241471;
19,948,562
ru
C#
array_ops
advanced
Напишите на C# функцию, которая фильтрует только четные числа из списка.
public System.Collections.Generic.List<int> Filter(int[] arr) { var res = new System.Collections.Generic.List<int>(); foreach(int x in arr) if(x % 2 == 0) res.Add(x); return res; }
### Instruction: Напишите на C# функцию, которая фильтрует только четные числа из списка. ### Response: public System.Collections.Generic.List<int> Filter(int[] arr) { var res = new System.Collections.Generic.List<int>(); foreach(int x in arr) if(x % 2 == 0) res.Add(x); return res; }
3,073,896
kk
C#
var_decl
beginner
C# тілінде 622513 мәнімен y айнымалысын қалай жариялауға болады?
int y = 622513;
### Instruction: C# тілінде 622513 мәнімен y айнымалысын қалай жариялауға болады? ### Response: int y = 622513;
48,671,116
ru
JavaScript
string_ops
intermediate
Напишите на JavaScript функцию, которая проверяет, является ли строка палиндромом.
const isPalindrome = s => s === s.split('').reverse().join('');
### Instruction: Напишите на JavaScript функцию, которая проверяет, является ли строка палиндромом. ### Response: const isPalindrome = s => s === s.split('').reverse().join('');
15,140,443
kk
Unity
logic_ops
advanced
Unity тилінде 2033 жылы кібісе жыл екенін тексеретін логиканы жазыңыз.
public bool IsLeap() { int y = 2033; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
### Instruction: Unity тилінде 2033 жылы кібісе жыл екенін тексеретін логиканы жазыңыз. ### Response: public bool IsLeap() { int y = 2033; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
66,974,986
kk
Java
string_ops
advanced
Java тилінде мәтіндегі дауысты әріптердің санын есептейтін функцияны жазыңыз.
public int CountVowels(string s) { int c = 0; foreach(char ch in s.ToLower()) if("aeiou".Contains(ch)) c++; return c; }
### Instruction: Java тилінде мәтіндегі дауысты әріптердің санын есептейтін функцияны жазыңыз. ### Response: public int CountVowels(string s) { int c = 0; foreach(char ch in s.ToLower()) if("aeiou".Contains(ch)) c++; return c; }
92,043,975
en
JavaScript
array_ops
intermediate
Write a function that filters only even numbers from a list in JavaScript.
const filterEven = arr => arr.filter(x => x % 2 === 0);
### Instruction: Write a function that filters only even numbers from a list in JavaScript. ### Response: const filterEven = arr => arr.filter(x => x % 2 === 0);
17,498,976
en
JavaScript
string_ops
advanced
Write a function that counts vowels in a text in JavaScript.
const countVowels = s => (s.match(/[aeiou]/gi) || []).length;
### Instruction: Write a function that counts vowels in a text in JavaScript. ### Response: const countVowels = s => (s.match(/[aeiou]/gi) || []).length;
734,609
ru
Java
factorial
advanced
Напиши функцию на Java, которая вычисляет факториал числа 2312.
static long factorial(int n) { return n <= 1 ? 1 : n * factorial(n - 1); } System.out.println(factorial(2312));
### Instruction: Напиши функцию на Java, которая вычисляет факториал числа 2312. ### Response: static long factorial(int n) { return n <= 1 ? 1 : n * factorial(n - 1); } System.out.println(factorial(2312));
73,546,246
ru
C#
logic_ops
intermediate
Напишите на C# логику проверки, является ли год 2050 високосным.
public bool IsLeap() { int y = 2050; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
### Instruction: Напишите на C# логику проверки, является ли год 2050 високосным. ### Response: public bool IsLeap() { int y = 2050; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
36,197,766
ru
C#
logic_ops
advanced
Напишите на C# логику проверки, является ли год 2098 високосным.
public bool IsLeap() { int y = 2098; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
### Instruction: Напишите на C# логику проверки, является ли год 2098 високосным. ### Response: public bool IsLeap() { int y = 2098; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
1,211,854
ru
Java
var_decl
beginner
Как объявить переменную value со значением 345740 в Java?
int value = 345740;
### Instruction: Как объявить переменную value со значением 345740 в Java? ### Response: int value = 345740;
36,250,867
en
C#
array_ops
intermediate
Write a function that filters only even numbers from a list in C#.
public System.Collections.Generic.List<int> Filter(int[] arr) { var res = new System.Collections.Generic.List<int>(); foreach(int x in arr) if(x % 2 == 0) res.Add(x); return res; }
### Instruction: Write a function that filters only even numbers from a list in C#. ### Response: public System.Collections.Generic.List<int> Filter(int[] arr) { var res = new System.Collections.Generic.List<int>(); foreach(int x in arr) if(x % 2 == 0) res.Add(x); return res; }
96,357,909
en
Java
array_ops
advanced
Write a function that reverses a list in Java.
public void Reverse(int[] arr) { System.Array.Reverse(arr); }
### Instruction: Write a function that reverses a list in Java. ### Response: public void Reverse(int[] arr) { System.Array.Reverse(arr); }