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
29,588,309
en
Python
string_ops
intermediate
Write a function that checks if a string is a palindrome in Python.
def is_palindrome(s): return s == s[::-1]
### Instruction: Write a function that checks if a string is a palindrome in Python. ### Response: def is_palindrome(s): return s == s[::-1]
1,234,374
kk
Python
var_decl
beginner
Python тілінде 992291 мәнімен x айнымалысын қалай жариялауға болады?
x = 992291
### Instruction: Python тілінде 992291 мәнімен x айнымалысын қалай жариялауға болады? ### Response: x = 992291
21,333,567
ru
Unity
logic_ops
intermediate
Напишите на Unity логику проверки, является ли год 1997 високосным.
public bool IsLeap() { int y = 1997; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
### Instruction: Напишите на Unity логику проверки, является ли год 1997 високосным. ### Response: public bool IsLeap() { int y = 1997; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
92,941,109
ru
Python
string_ops
advanced
Напишите на Python функцию, которая считает количество гласных букв в тексте.
def count_vowels(s): return sum(1 for c in s if c in 'aeiouAEIOUаеёиоуыэюя')
### Instruction: Напишите на Python функцию, которая считает количество гласных букв в тексте. ### Response: def count_vowels(s): return sum(1 for c in s if c in 'aeiouAEIOUаеёиоуыэюя')
74,809,034
kk
JavaScript
string_ops
intermediate
JavaScript тилінде мәтіндегі дауысты әріптердің санын есептейтін функцияны жазыңыз.
const countVowels = s => (s.match(/[aeiou]/gi) || []).length;
### Instruction: JavaScript тилінде мәтіндегі дауысты әріптердің санын есептейтін функцияны жазыңыз. ### Response: const countVowels = s => (s.match(/[aeiou]/gi) || []).length;
10,735,314
ru
Unity
string_ops
intermediate
Напишите на Unity функцию, которая переводит строку в верхний регистр.
public string ToUpper(string s) { return s.ToUpper(); }
### Instruction: Напишите на Unity функцию, которая переводит строку в верхний регистр. ### Response: public string ToUpper(string s) { return s.ToUpper(); }
96,934,836
en
C#
logic_ops
intermediate
Write a function that determines if the number 444 is prime in C#.
public bool IsPrime() { int n = 444; 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 444 is prime in C#. ### Response: public bool IsPrime() { int n = 444; if (n <= 1) return false; for (int i = 2; i * i <= n; i++) if (n % i == 0) return false; return true; }
4,524,711
en
JavaScript
var_decl
beginner
How to declare a variable y with value 853338 in JavaScript?
let y = 853338;
### Instruction: How to declare a variable y with value 853338 in JavaScript? ### Response: let y = 853338;
32,570,634
ru
C#
array_ops
intermediate
Напишите на C# функцию, которая находит максимальное число в массиве.
public int GetMax(int[] arr) { int max = arr[0]; foreach(int x in arr) if(x > max) max = x; return max; }
### Instruction: Напишите на C# функцию, которая находит максимальное число в массиве. ### Response: public int GetMax(int[] arr) { int max = arr[0]; foreach(int x in arr) if(x > max) max = x; return max; }
69,410,495
ru
C#
string_ops
intermediate
Напишите на 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; }
3,647,619
kk
Unity
var_decl
beginner
Unity тілінде 855475 мәнімен result айнымалысын қалай жариялауға болады?
int result = 855475;
### Instruction: Unity тілінде 855475 мәнімен result айнымалысын қалай жариялауға болады? ### Response: int result = 855475;
1,532,449
ru
Unity
var_decl
beginner
Как объявить переменную count со значением 632918 в Unity?
int count = 632918;
### Instruction: Как объявить переменную count со значением 632918 в Unity? ### Response: int count = 632918;
80,102,231
ru
JavaScript
array_ops
advanced
Напишите на JavaScript функцию, которая разворачивает список задом наперед.
const reverseArr = arr => arr.reverse();
### Instruction: Напишите на JavaScript функцию, которая разворачивает список задом наперед. ### Response: const reverseArr = arr => arr.reverse();
82,942,710
kk
Python
logic_ops
advanced
Python тилінде 2096 жылы кібісе жыл екенін тексеретін логиканы жазыңыз.
def is_leap(): year = 2096 return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0)
### Instruction: Python тилінде 2096 жылы кібісе жыл екенін тексеретін логиканы жазыңыз. ### Response: def is_leap(): year = 2096 return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0)
917,985
ru
Java
var_decl
beginner
Как объявить переменную value со значением 892815 в Java?
int value = 892815;
### Instruction: Как объявить переменную value со значением 892815 в Java? ### Response: int value = 892815;
31,311,094
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(); }
1,823,638
ru
Java
var_decl
beginner
Как объявить переменную index со значением 755133 в Java?
int index = 755133;
### Instruction: Как объявить переменную index со значением 755133 в Java? ### Response: int index = 755133;
35,461,863
en
Python
logic_ops
advanced
Write a function that determines if the number 244 is prime in Python.
def is_prime(): n = 244 return n > 1 and all(n % i != 0 for i in range(2, int(n**0.5) + 1))
### Instruction: Write a function that determines if the number 244 is prime in Python. ### Response: def is_prime(): n = 244 return n > 1 and all(n % i != 0 for i in range(2, int(n**0.5) + 1))
43,944,289
kk
JavaScript
logic_ops
intermediate
JavaScript тилінде 403 санының жай сан екенін анықтайтын функцияны жазыңыз.
function isPrime() { let n = 403; if (n <= 1) return false; for (let i = 2; i * i <= n; i++) if (n % i === 0) return false; return true; }
### Instruction: JavaScript тилінде 403 санының жай сан екенін анықтайтын функцияны жазыңыз. ### Response: function isPrime() { let n = 403; if (n <= 1) return false; for (let i = 2; i * i <= n; i++) if (n % i === 0) return false; return true; }
74,354,513
en
Unity
logic_ops
advanced
Write a function that determines if the number 427 is prime in Unity.
public bool IsPrime() { int n = 427; 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 427 is prime in Unity. ### Response: public bool IsPrime() { int n = 427; if (n <= 1) return false; for (int i = 2; i * i <= n; i++) if (n % i == 0) return false; return true; }
84,611,330
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(); }
790,995
en
Unity
var_decl
beginner
How to declare a variable index with value 345751 in Unity?
int index = 345751;
### Instruction: How to declare a variable index with value 345751 in Unity? ### Response: int index = 345751;
89,702,783
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; }
3,907,891
en
C++
var_decl
beginner
How to declare a variable level with value 709253 in C++?
int level = 709253;
### Instruction: How to declare a variable level with value 709253 in C++? ### Response: int level = 709253;
99,042,833
ru
Java
array_ops
intermediate
Напишите на Java функцию, которая разворачивает список задом наперед.
public void Reverse(int[] arr) { System.Array.Reverse(arr); }
### Instruction: Напишите на Java функцию, которая разворачивает список задом наперед. ### Response: public void Reverse(int[] arr) { System.Array.Reverse(arr); }
29,771,314
en
Python
string_ops
advanced
Write a function that counts vowels in a text in Python.
def count_vowels(s): return sum(1 for c in s if c in 'aeiouAEIOUаеёиоуыэюя')
### Instruction: Write a function that counts vowels in a text in Python. ### Response: def count_vowels(s): return sum(1 for c in s if c in 'aeiouAEIOUаеёиоуыэюя')
3,516,734
en
C#
var_decl
beginner
How to declare a variable result with value 796476 in C#?
int result = 796476;
### Instruction: How to declare a variable result with value 796476 in C#? ### Response: int result = 796476;
319,802
kk
JavaScript
factorial
advanced
JavaScript тілінде 4111 санының факториалын есептейтін функция жаз.
function factorial(n) { return n <= 1 ? 1 : n * factorial(n - 1); } console.log(factorial(4111));
### Instruction: JavaScript тілінде 4111 санының факториалын есептейтін функция жаз. ### Response: function factorial(n) { return n <= 1 ? 1 : n * factorial(n - 1); } console.log(factorial(4111));
4,549,744
en
JavaScript
var_decl
beginner
How to declare a variable level with value 254703 in JavaScript?
let level = 254703;
### Instruction: How to declare a variable level with value 254703 in JavaScript? ### Response: let level = 254703;
2,649,582
kk
JavaScript
var_decl
beginner
JavaScript тілінде 556228 мәнімен amount айнымалысын қалай жариялауға болады?
let amount = 556228;
### Instruction: JavaScript тілінде 556228 мәнімен amount айнымалысын қалай жариялауға болады? ### Response: let amount = 556228;
25,382,361
en
Python
string_ops
intermediate
Write a function that checks if a string is a palindrome in Python.
def is_palindrome(s): return s == s[::-1]
### Instruction: Write a function that checks if a string is a palindrome in Python. ### Response: def is_palindrome(s): return s == s[::-1]
19,537,046
kk
Python
array_ops
intermediate
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]
920,179
kk
Java
sum_n
intermediate
Java тілінде 1-ден 3215-ге дейінгі сандардың қосындысын есептейтін функция жаз.
static int sumToN(int n) { int s = 0; for (int i = 1; i <= n; i++) s += i; return s; } System.out.println(sumToN(3215));
### Instruction: Java тілінде 1-ден 3215-ге дейінгі сандардың қосындысын есептейтін функция жаз. ### Response: static int sumToN(int n) { int s = 0; for (int i = 1; i <= n; i++) s += i; return s; } System.out.println(sumToN(3215));
2,980,503
ru
C++
var_decl
beginner
Как объявить переменную timer со значением 906512 в C++?
int timer = 906512;
### Instruction: Как объявить переменную timer со значением 906512 в C++? ### Response: int timer = 906512;
395,487
kk
Java
factorial
advanced
Java тілінде 1622 санының факториалын есептейтін функция жаз.
static long factorial(int n) { return n <= 1 ? 1 : n * factorial(n - 1); } System.out.println(factorial(1622));
### Instruction: Java тілінде 1622 санының факториалын есептейтін функция жаз. ### Response: static long factorial(int n) { return n <= 1 ? 1 : n * factorial(n - 1); } System.out.println(factorial(1622));
174,765
ru
C#
factorial
advanced
Напиши функцию на C#, которая вычисляет факториал числа 9841.
static long Factorial(int n) { return n <= 1 ? 1 : n * Factorial(n - 1); } Console.WriteLine(Factorial(9841));
### Instruction: Напиши функцию на C#, которая вычисляет факториал числа 9841. ### Response: static long Factorial(int n) { return n <= 1 ? 1 : n * Factorial(n - 1); } Console.WriteLine(Factorial(9841));
59,117,654
en
C#
array_ops
advanced
Write a function that finds the maximum number in an array in C#.
public int GetMax(int[] arr) { int max = arr[0]; foreach(int x in arr) if(x > max) max = x; return max; }
### Instruction: Write a function that finds the maximum number in an array in C#. ### Response: public int GetMax(int[] arr) { int max = arr[0]; foreach(int x in arr) if(x > max) max = x; return max; }
1,988,168
en
C++
var_decl
beginner
How to declare a variable health with value 797209 in C++?
int health = 797209;
### Instruction: How to declare a variable health with value 797209 in C++? ### Response: int health = 797209;
24,372,013
kk
Unity
string_ops
intermediate
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; }
1,023,087
en
C++
sum_n
intermediate
Write a function in C++ that sums numbers from 1 to 5673.
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(5673) << std::endl;
### Instruction: Write a function in C++ that sums numbers from 1 to 5673. ### 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(5673) << std::endl;
43,272,081
kk
C++
string_ops
advanced
C++ тилінде жолды жоғарғы регистрге ауыстыратын функцияны жазыңыз.
public string ToUpper(string s) { return s.ToUpper(); }
### Instruction: C++ тилінде жолды жоғарғы регистрге ауыстыратын функцияны жазыңыз. ### Response: public string ToUpper(string s) { return s.ToUpper(); }
309,031
ru
Python
sum_n
intermediate
Напиши функцию на Python, которая считает сумму чисел от 1 до 9831.
def sum_to_n(n): return sum(range(1, n + 1)) print(sum_to_n(9831))
### Instruction: Напиши функцию на Python, которая считает сумму чисел от 1 до 9831. ### Response: def sum_to_n(n): return sum(range(1, n + 1)) print(sum_to_n(9831))
3,132,255
en
Unity
var_decl
beginner
How to declare a variable speed with value 753664 in Unity?
int speed = 753664;
### Instruction: How to declare a variable speed with value 753664 in Unity? ### Response: int speed = 753664;
3,648,394
ru
Python
var_decl
beginner
Как объявить переменную total со значением 651151 в Python?
total = 651151
### Instruction: Как объявить переменную total со значением 651151 в Python? ### Response: total = 651151
3,538,150
ru
Unity
var_decl
beginner
Как объявить переменную rate со значением 675293 в Unity?
int rate = 675293;
### Instruction: Как объявить переменную rate со значением 675293 в Unity? ### Response: int rate = 675293;
2,031,111
kk
Java
var_decl
beginner
Java тілінде 302519 мәнімен data айнымалысын қалай жариялауға болады?
int data = 302519;
### Instruction: Java тілінде 302519 мәнімен data айнымалысын қалай жариялауға болады? ### Response: int data = 302519;
3,054,592
en
Python
var_decl
beginner
How to declare a variable buffer with value 552178 in Python?
buffer = 552178
### Instruction: How to declare a variable buffer with value 552178 in Python? ### Response: buffer = 552178
83,517,176
ru
Python
logic_ops
intermediate
Напишите на Python логику проверки, является ли год 1974 високосным.
def is_leap(): year = 1974 return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0)
### Instruction: Напишите на Python логику проверки, является ли год 1974 високосным. ### Response: def is_leap(): year = 1974 return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0)
839,521
ru
C#
var_decl
beginner
Как объявить переменную score со значением 731240 в C#?
int score = 731240;
### Instruction: Как объявить переменную score со значением 731240 в C#? ### Response: int score = 731240;
33,095,440
kk
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,730,470
ru
Python
array_ops
advanced
Напишите на Python функцию, которая разворачивает список задом наперед.
def reverse_list(arr): return arr[::-1]
### Instruction: Напишите на Python функцию, которая разворачивает список задом наперед. ### Response: def reverse_list(arr): return arr[::-1]
37,171,082
en
C#
array_ops
intermediate
Write a function that finds the maximum number in an array in C#.
public int GetMax(int[] arr) { int max = arr[0]; foreach(int x in arr) if(x > max) max = x; return max; }
### Instruction: Write a function that finds the maximum number in an array in C#. ### Response: public int GetMax(int[] arr) { int max = arr[0]; foreach(int x in arr) if(x > max) max = x; return max; }
94,408,135
ru
C#
string_ops
intermediate
Напишите на 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; }
68,906,838
kk
Python
array_ops
intermediate
Python тилінде тізімді керісінше айналдыратын функцияны жазыңыз.
def reverse_list(arr): return arr[::-1]
### Instruction: Python тилінде тізімді керісінше айналдыратын функцияны жазыңыз. ### Response: def reverse_list(arr): return arr[::-1]
432,799
kk
Unity
sum_n
intermediate
Unity тілінде 1-ден 3211-ге дейінгі сандардың қосындысын есептейтін функция жаз.
int SumToN(int n) { int s = 0; for (int i = 1; i <= n; i++) s += i; return s; } void Start() { Debug.Log(SumToN(3211)); }
### Instruction: Unity тілінде 1-ден 3211-ге дейінгі сандардың қосындысын есептейтін функция жаз. ### Response: int SumToN(int n) { int s = 0; for (int i = 1; i <= n; i++) s += i; return s; } void Start() { Debug.Log(SumToN(3211)); }
26,400,977
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); }
90,273,775
ru
C++
logic_ops
intermediate
Напишите на C++ логику проверки, является ли год 2087 високосным.
public bool IsLeap() { int y = 2087; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
### Instruction: Напишите на C++ логику проверки, является ли год 2087 високосным. ### Response: public bool IsLeap() { int y = 2087; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
2,212,399
kk
Java
var_decl
beginner
Java тілінде 988376 мәнімен speed айнымалысын қалай жариялауға болады?
int speed = 988376;
### Instruction: Java тілінде 988376 мәнімен speed айнымалысын қалай жариялауға болады? ### Response: int speed = 988376;
96,458,616
ru
Java
array_ops
intermediate
Напишите на 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: Напишите на 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,780,853
kk
Java
var_decl
beginner
Java тілінде 18604 мәнімен weight айнымалысын қалай жариялауға болады?
int weight = 18604;
### Instruction: Java тілінде 18604 мәнімен weight айнымалысын қалай жариялауға болады? ### Response: int weight = 18604;
90,482,662
kk
C++
logic_ops
advanced
C++ тилінде 40 санының жай сан екенін анықтайтын функцияны жазыңыз.
public bool IsPrime() { int n = 40; if (n <= 1) return false; for (int i = 2; i * i <= n; i++) if (n % i == 0) return false; return true; }
### Instruction: C++ тилінде 40 санының жай сан екенін анықтайтын функцияны жазыңыз. ### Response: public bool IsPrime() { int n = 40; if (n <= 1) return false; for (int i = 2; i * i <= n; i++) if (n % i == 0) return false; return true; }
26,739,203
kk
C++
logic_ops
intermediate
C++ тилінде 2096 жылы кібісе жыл екенін тексеретін логиканы жазыңыз.
public bool IsLeap() { int y = 2096; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
### Instruction: C++ тилінде 2096 жылы кібісе жыл екенін тексеретін логиканы жазыңыз. ### Response: public bool IsLeap() { int y = 2096; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
43,665,141
kk
Python
array_ops
intermediate
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]
1,262,516
ru
JavaScript
var_decl
beginner
Как объявить переменную limit со значением 787615 в JavaScript?
let limit = 787615;
### Instruction: Как объявить переменную limit со значением 787615 в JavaScript? ### Response: let limit = 787615;
735,582
kk
C++
factorial
advanced
C++ тілінде 5236 санының факториалын есептейтін функция жаз.
long long factorial(int n) { return n <= 1 ? 1 : n * factorial(n - 1); } std::cout << factorial(5236) << std::endl;
### Instruction: C++ тілінде 5236 санының факториалын есептейтін функция жаз. ### Response: long long factorial(int n) { return n <= 1 ? 1 : n * factorial(n - 1); } std::cout << factorial(5236) << std::endl;
74,636,911
en
C#
string_ops
intermediate
Write a function that converts a string to uppercase in C#.
public string ToUpper(string s) { return s.ToUpper(); }
### Instruction: Write a function that converts a string to uppercase in C#. ### Response: public string ToUpper(string s) { return s.ToUpper(); }
24,117,253
kk
C++
array_ops
advanced
C++ тилінде жиымдағы ең үлкен санды табатын функцияны жазыңыз.
public int GetMax(int[] arr) { int max = arr[0]; foreach(int x in arr) if(x > max) max = x; return max; }
### Instruction: C++ тилінде жиымдағы ең үлкен санды табатын функцияны жазыңыз. ### Response: public int GetMax(int[] arr) { int max = arr[0]; foreach(int x in arr) if(x > max) max = x; return max; }
20,940,284
en
Java
string_ops
advanced
Write a function that counts vowels in a text in Java.
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 Java. ### Response: public int CountVowels(string s) { int c = 0; foreach(char ch in s.ToLower()) if("aeiou".Contains(ch)) c++; return c; }
88,566,000
en
Unity
logic_ops
intermediate
Write logic to check if the year 1997 is a leap year in Unity.
public bool IsLeap() { int y = 1997; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
### Instruction: Write logic to check if the year 1997 is a leap year in Unity. ### Response: public bool IsLeap() { int y = 1997; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
40,248,791
ru
Unity
string_ops
intermediate
Напишите на 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; }
367,369
en
Python
sum_n
intermediate
Write a function in Python that sums numbers from 1 to 5825.
def sum_to_n(n): return sum(range(1, n + 1)) print(sum_to_n(5825))
### Instruction: Write a function in Python that sums numbers from 1 to 5825. ### Response: def sum_to_n(n): return sum(range(1, n + 1)) print(sum_to_n(5825))
25,929,505
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]
34,670,522
en
JavaScript
array_ops
advanced
Write a function that reverses a list in JavaScript.
const reverseArr = arr => arr.reverse();
### Instruction: Write a function that reverses a list in JavaScript. ### Response: const reverseArr = arr => arr.reverse();
125,971
ru
Python
sum_n
intermediate
Напиши функцию на Python, которая считает сумму чисел от 1 до 300.
def sum_to_n(n): return sum(range(1, n + 1)) print(sum_to_n(300))
### Instruction: Напиши функцию на Python, которая считает сумму чисел от 1 до 300. ### Response: def sum_to_n(n): return sum(range(1, n + 1)) print(sum_to_n(300))
393,145
en
Unity
var_decl
beginner
How to declare a variable speed with value 634543 in Unity?
int speed = 634543;
### Instruction: How to declare a variable speed with value 634543 in Unity? ### Response: int speed = 634543;
258,556
ru
C#
sum_n
intermediate
Напиши функцию на C#, которая считает сумму чисел от 1 до 6894.
static int SumToN(int n) { int s = 0; for (int i = 1; i <= n; i++) s += i; return s; } Console.WriteLine(SumToN(6894));
### Instruction: Напиши функцию на C#, которая считает сумму чисел от 1 до 6894. ### Response: static int SumToN(int n) { int s = 0; for (int i = 1; i <= n; i++) s += i; return s; } Console.WriteLine(SumToN(6894));
63,593,824
ru
JavaScript
logic_ops
intermediate
Напишите на JavaScript логику проверки, является ли год 1940 високосным.
function isLeap() { let y = 1940; return y % 4 === 0 && (y % 100 !== 0 || y % 400 === 0); }
### Instruction: Напишите на JavaScript логику проверки, является ли год 1940 високосным. ### Response: function isLeap() { let y = 1940; return y % 4 === 0 && (y % 100 !== 0 || y % 400 === 0); }
2,589,696
kk
JavaScript
var_decl
beginner
JavaScript тілінде 194783 мәнімен buffer айнымалысын қалай жариялауға болады?
let buffer = 194783;
### Instruction: JavaScript тілінде 194783 мәнімен buffer айнымалысын қалай жариялауға болады? ### Response: let buffer = 194783;
634,791
en
C#
sum_n
intermediate
Write a function in C# that sums numbers from 1 to 4353.
static int SumToN(int n) { int s = 0; for (int i = 1; i <= n; i++) s += i; return s; } Console.WriteLine(SumToN(4353));
### Instruction: Write a function in C# that sums numbers from 1 to 4353. ### Response: static int SumToN(int n) { int s = 0; for (int i = 1; i <= n; i++) s += i; return s; } Console.WriteLine(SumToN(4353));
47,221,271
en
JavaScript
array_ops
advanced
Write a function that finds the maximum number in an array in JavaScript.
const getMax = arr => Math.max(...arr);
### Instruction: Write a function that finds the maximum number in an array in JavaScript. ### Response: const getMax = arr => Math.max(...arr);
86,403,995
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; }
143,296
ru
Python
sum_n
intermediate
Напиши функцию на Python, которая считает сумму чисел от 1 до 5662.
def sum_to_n(n): return sum(range(1, n + 1)) print(sum_to_n(5662))
### Instruction: Напиши функцию на Python, которая считает сумму чисел от 1 до 5662. ### Response: def sum_to_n(n): return sum(range(1, n + 1)) print(sum_to_n(5662))
2,375,243
ru
Unity
var_decl
beginner
Как объявить переменную offset со значением 282156 в Unity?
int offset = 282156;
### Instruction: Как объявить переменную offset со значением 282156 в Unity? ### Response: int offset = 282156;
49,192,695
ru
C#
string_ops
intermediate
Напишите на C# функцию, которая переводит строку в верхний регистр.
public string ToUpper(string s) { return s.ToUpper(); }
### Instruction: Напишите на C# функцию, которая переводит строку в верхний регистр. ### Response: public string ToUpper(string s) { return s.ToUpper(); }
30,084,636
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; }
603,779
ru
Python
var_decl
beginner
Как объявить переменную total со значением 621034 в Python?
total = 621034
### Instruction: Как объявить переменную total со значением 621034 в Python? ### Response: total = 621034
671,188
en
JavaScript
sum_n
intermediate
Write a function in JavaScript that sums numbers from 1 to 251.
function sumToN(n) { let s = 0; for (let i = 1; i <= n; i++) s += i; return s; } console.log(sumToN(251));
### Instruction: Write a function in JavaScript that sums numbers from 1 to 251. ### Response: function sumToN(n) { let s = 0; for (let i = 1; i <= n; i++) s += i; return s; } console.log(sumToN(251));
96,613,251
en
Python
string_ops
intermediate
Write a function that checks if a string is a palindrome in Python.
def is_palindrome(s): return s == s[::-1]
### Instruction: Write a function that checks if a string is a palindrome in Python. ### Response: def is_palindrome(s): return s == s[::-1]
720,985
kk
Java
sum_n
intermediate
Java тілінде 1-ден 7201-ге дейінгі сандардың қосындысын есептейтін функция жаз.
static int sumToN(int n) { int s = 0; for (int i = 1; i <= n; i++) s += i; return s; } System.out.println(sumToN(7201));
### Instruction: Java тілінде 1-ден 7201-ге дейінгі сандардың қосындысын есептейтін функция жаз. ### Response: static int sumToN(int n) { int s = 0; for (int i = 1; i <= n; i++) s += i; return s; } System.out.println(sumToN(7201));
71,115,060
en
C#
logic_ops
intermediate
Write a function that determines if the number 473 is prime in C#.
public bool IsPrime() { int n = 473; 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 473 is prime in C#. ### Response: public bool IsPrime() { int n = 473; if (n <= 1) return false; for (int i = 2; i * i <= n; i++) if (n % i == 0) return false; return true; }
29,096,563
en
Java
array_ops
advanced
Write a function that finds the maximum number in an array in Java.
public int GetMax(int[] arr) { int max = arr[0]; foreach(int x in arr) if(x > max) max = x; return max; }
### Instruction: Write a function that finds the maximum number in an array in Java. ### Response: public int GetMax(int[] arr) { int max = arr[0]; foreach(int x in arr) if(x > max) max = x; return max; }
91,216,863
kk
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; }
40,588,211
kk
Unity
logic_ops
intermediate
Unity тилінде 1937 жылы кібісе жыл екенін тексеретін логиканы жазыңыз.
public bool IsLeap() { int y = 1937; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
### Instruction: Unity тилінде 1937 жылы кібісе жыл екенін тексеретін логиканы жазыңыз. ### Response: public bool IsLeap() { int y = 1937; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
81,448,824
kk
JavaScript
string_ops
intermediate
JavaScript тилінде жолды жоғарғы регистрге ауыстыратын функцияны жазыңыз.
const toUpper = s => s.toUpperCase();
### Instruction: JavaScript тилінде жолды жоғарғы регистрге ауыстыратын функцияны жазыңыз. ### Response: const toUpper = s => s.toUpperCase();
2,967,219
ru
JavaScript
var_decl
beginner
Как объявить переменную timer со значением 496060 в JavaScript?
let timer = 496060;
### Instruction: Как объявить переменную timer со значением 496060 в JavaScript? ### Response: let timer = 496060;
3,855,517
en
C#
var_decl
beginner
How to declare a variable offset with value 767359 in C#?
int offset = 767359;
### Instruction: How to declare a variable offset with value 767359 in C#? ### Response: int offset = 767359;
776,627
kk
C#
sum_n
intermediate
C# тілінде 1-ден 9974-ге дейінгі сандардың қосындысын есептейтін функция жаз.
static int SumToN(int n) { int s = 0; for (int i = 1; i <= n; i++) s += i; return s; } Console.WriteLine(SumToN(9974));
### Instruction: C# тілінде 1-ден 9974-ге дейінгі сандардың қосындысын есептейтін функция жаз. ### Response: static int SumToN(int n) { int s = 0; for (int i = 1; i <= n; i++) s += i; return s; } Console.WriteLine(SumToN(9974));
4,694,961
en
Unity
var_decl
beginner
How to declare a variable index with value 73041 in Unity?
int index = 73041;
### Instruction: How to declare a variable index with value 73041 in Unity? ### Response: int index = 73041;
49,696,254
ru
C++
string_ops
intermediate
Напишите на 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; }
37,094,580
ru
Python
array_ops
intermediate
Напишите на Python функцию, которая находит максимальное число в массиве.
def get_max(arr): return max(arr)
### Instruction: Напишите на Python функцию, которая находит максимальное число в массиве. ### Response: def get_max(arr): return max(arr)