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
28,650,208
en
JavaScript
string_ops
intermediate
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;
69,127,411
ru
Java
string_ops
advanced
Напишите на 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; }
80,581,902
en
Python
array_ops
intermediate
Write a function that filters only even numbers from a list in Python.
def filter_even(arr): return [x for x in arr if x % 2 == 0]
### Instruction: Write a function that filters only even numbers from a list in Python. ### Response: def filter_even(arr): return [x for x in arr if x % 2 == 0]
3,362,139
kk
Java
var_decl
beginner
Java тілінде 181000 мәнімен amount айнымалысын қалай жариялауға болады?
int amount = 181000;
### Instruction: Java тілінде 181000 мәнімен amount айнымалысын қалай жариялауға болады? ### Response: int amount = 181000;
68,545,418
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);
68,412,051
en
Unity
string_ops
intermediate
Write a function that checks if a string is a palindrome in 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: Write a function that checks if a string is a palindrome in 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; }
87,784,825
en
JavaScript
logic_ops
advanced
Write a function that determines if the number 466 is prime in JavaScript.
function isPrime() { let n = 466; 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 466 is prime in JavaScript. ### Response: function isPrime() { let n = 466; if (n <= 1) return false; for (let i = 2; i * i <= n; i++) if (n % i === 0) return false; return true; }
382,566
ru
C#
factorial
advanced
Напиши функцию на C#, которая вычисляет факториал числа 8274.
static long Factorial(int n) { return n <= 1 ? 1 : n * Factorial(n - 1); } Console.WriteLine(Factorial(8274));
### Instruction: Напиши функцию на C#, которая вычисляет факториал числа 8274. ### Response: static long Factorial(int n) { return n <= 1 ? 1 : n * Factorial(n - 1); } Console.WriteLine(Factorial(8274));
2,352,549
ru
Unity
var_decl
beginner
Как объявить переменную limit со значением 237548 в Unity?
int limit = 237548;
### Instruction: Как объявить переменную limit со значением 237548 в Unity? ### Response: int limit = 237548;
67,972,130
kk
JavaScript
string_ops
advanced
JavaScript тилінде жолды жоғарғы регистрге ауыстыратын функцияны жазыңыз.
const toUpper = s => s.toUpperCase();
### Instruction: JavaScript тилінде жолды жоғарғы регистрге ауыстыратын функцияны жазыңыз. ### Response: const toUpper = s => s.toUpperCase();
2,337,589
en
C#
var_decl
beginner
How to declare a variable offset with value 887044 in C#?
int offset = 887044;
### Instruction: How to declare a variable offset with value 887044 in C#? ### Response: int offset = 887044;
97,824,027
ru
JavaScript
array_ops
advanced
Напишите на JavaScript функцию, которая находит максимальное число в массиве.
const getMax = arr => Math.max(...arr);
### Instruction: Напишите на JavaScript функцию, которая находит максимальное число в массиве. ### Response: const getMax = arr => Math.max(...arr);
9,305
ru
Python
var_decl
beginner
Как объявить переменную weight со значением 915388 в Python?
weight = 915388
### Instruction: Как объявить переменную weight со значением 915388 в Python? ### Response: weight = 915388
17,054,292
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(); }
370,274
ru
Unity
factorial
advanced
Напиши функцию на Unity, которая вычисляет факториал числа 290.
long Factorial(int n) { return n <= 1 ? 1 : n * Factorial(n - 1); } void Start() { Debug.Log(Factorial(290)); }
### Instruction: Напиши функцию на Unity, которая вычисляет факториал числа 290. ### Response: long Factorial(int n) { return n <= 1 ? 1 : n * Factorial(n - 1); } void Start() { Debug.Log(Factorial(290)); }
1,415,375
kk
C#
var_decl
beginner
C# тілінде 840008 мәнімен weight айнымалысын қалай жариялауға болады?
int weight = 840008;
### Instruction: C# тілінде 840008 мәнімен weight айнымалысын қалай жариялауға болады? ### Response: int weight = 840008;
4,163,990
kk
C++
var_decl
beginner
C++ тілінде 177999 мәнімен level айнымалысын қалай жариялауға болады?
int level = 177999;
### Instruction: C++ тілінде 177999 мәнімен level айнымалысын қалай жариялауға болады? ### Response: int level = 177999;
19,848,723
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; }
3,716,725
kk
C++
var_decl
beginner
C++ тілінде 621271 мәнімен data айнымалысын қалай жариялауға болады?
int data = 621271;
### Instruction: C++ тілінде 621271 мәнімен data айнымалысын қалай жариялауға болады? ### Response: int data = 621271;
24,948,772
kk
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); }
11,842,259
en
C#
logic_ops
intermediate
Write logic to check if the year 1904 is a leap year in C#.
public bool IsLeap() { int y = 1904; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
### Instruction: Write logic to check if the year 1904 is a leap year in C#. ### Response: public bool IsLeap() { int y = 1904; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
99,732,886
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;
20,219,601
en
Unity
logic_ops
intermediate
Write logic to check if the year 2098 is a leap year in Unity.
public bool IsLeap() { int y = 2098; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
### Instruction: Write logic to check if the year 2098 is a leap year in Unity. ### Response: public bool IsLeap() { int y = 2098; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
62,848,491
ru
Python
array_ops
intermediate
Напишите на Python функцию, которая находит максимальное число в массиве.
def get_max(arr): return max(arr)
### Instruction: Напишите на Python функцию, которая находит максимальное число в массиве. ### Response: def get_max(arr): return max(arr)
51,124
ru
Python
var_decl
beginner
Как объявить переменную count со значением 709094 в Python?
count = 709094
### Instruction: Как объявить переменную count со значением 709094 в Python? ### Response: count = 709094
35,940,385
kk
C++
array_ops
intermediate
C++ тилінде тізімді керісінше айналдыратын функцияны жазыңыз.
public void Reverse(int[] arr) { System.Array.Reverse(arr); }
### Instruction: C++ тилінде тізімді керісінше айналдыратын функцияны жазыңыз. ### Response: public void Reverse(int[] arr) { System.Array.Reverse(arr); }
30,457,880
en
Java
string_ops
advanced
Write a function that converts a string to uppercase in Java.
public string ToUpper(string s) { return s.ToUpper(); }
### Instruction: Write a function that converts a string to uppercase in Java. ### Response: public string ToUpper(string s) { return s.ToUpper(); }
87,744,896
en
Unity
logic_ops
advanced
Write logic to check if the year 2033 is a leap year in Unity.
public bool IsLeap() { int y = 2033; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
### Instruction: Write logic to check if the year 2033 is a leap year in Unity. ### Response: public bool IsLeap() { int y = 2033; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
64,932,716
ru
Java
logic_ops
advanced
Напишите на Java функцию, определяющую, является ли число 60 простым.
public bool IsPrime() { int n = 60; if (n <= 1) return false; for (int i = 2; i * i <= n; i++) if (n % i == 0) return false; return true; }
### Instruction: Напишите на Java функцию, определяющую, является ли число 60 простым. ### Response: public bool IsPrime() { int n = 60; if (n <= 1) return false; for (int i = 2; i * i <= n; i++) if (n % i == 0) return false; return true; }
51,725,909
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; }
1,393,715
kk
C++
var_decl
beginner
C++ тілінде 965391 мәнімен speed айнымалысын қалай жариялауға болады?
int speed = 965391;
### Instruction: C++ тілінде 965391 мәнімен speed айнымалысын қалай жариялауға болады? ### Response: int speed = 965391;
11,847,904
kk
Python
string_ops
intermediate
Python тилінде жолдың палиндром екенін тексеретін функцияны жазыңыз.
def is_palindrome(s): return s == s[::-1]
### Instruction: Python тилінде жолдың палиндром екенін тексеретін функцияны жазыңыз. ### Response: def is_palindrome(s): return s == s[::-1]
87,881,425
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; }
45,077,780
ru
Java
string_ops
intermediate
Напишите на Java функцию, которая переводит строку в верхний регистр.
public string ToUpper(string s) { return s.ToUpper(); }
### Instruction: Напишите на Java функцию, которая переводит строку в верхний регистр. ### Response: public string ToUpper(string s) { return s.ToUpper(); }
2,725,018
en
C#
var_decl
beginner
How to declare a variable x with value 254103 in C#?
int x = 254103;
### Instruction: How to declare a variable x with value 254103 in C#? ### Response: int x = 254103;
150,624
en
Python
factorial
advanced
Write a function in Python that calculates the factorial of 9269.
def factorial(n): return 1 if n <= 1 else n * factorial(n - 1) print(factorial(9269))
### Instruction: Write a function in Python that calculates the factorial of 9269. ### Response: def factorial(n): return 1 if n <= 1 else n * factorial(n - 1) print(factorial(9269))
69,102,410
kk
Java
logic_ops
advanced
Java тилінде 346 санының жай сан екенін анықтайтын функцияны жазыңыз.
public bool IsPrime() { int n = 346; if (n <= 1) return false; for (int i = 2; i * i <= n; i++) if (n % i == 0) return false; return true; }
### Instruction: Java тилінде 346 санының жай сан екенін анықтайтын функцияны жазыңыз. ### Response: public bool IsPrime() { int n = 346; if (n <= 1) return false; for (int i = 2; i * i <= n; i++) if (n % i == 0) return false; return true; }
53,546,097
en
Java
string_ops
advanced
Write a function that converts a string to uppercase in Java.
public string ToUpper(string s) { return s.ToUpper(); }
### Instruction: Write a function that converts a string to uppercase in Java. ### Response: public string ToUpper(string s) { return s.ToUpper(); }
48,076,863
kk
Java
array_ops
advanced
Java тилінде жиымдағы ең үлкен санды табатын функцияны жазыңыз.
public int GetMax(int[] arr) { int max = arr[0]; foreach(int x in arr) if(x > max) max = x; return max; }
### Instruction: Java тилінде жиымдағы ең үлкен санды табатын функцияны жазыңыз. ### Response: public int GetMax(int[] arr) { int max = arr[0]; foreach(int x in arr) if(x > max) max = x; return max; }
70,819,534
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; }
3,882,649
en
C++
var_decl
beginner
How to declare a variable index with value 539902 in C++?
int index = 539902;
### Instruction: How to declare a variable index with value 539902 in C++? ### Response: int index = 539902;
590,852
kk
Java
factorial
advanced
Java тілінде 7290 санының факториалын есептейтін функция жаз.
static long factorial(int n) { return n <= 1 ? 1 : n * factorial(n - 1); } System.out.println(factorial(7290));
### Instruction: Java тілінде 7290 санының факториалын есептейтін функция жаз. ### Response: static long factorial(int n) { return n <= 1 ? 1 : n * factorial(n - 1); } System.out.println(factorial(7290));
72,940,571
ru
JavaScript
string_ops
advanced
Напишите на JavaScript функцию, которая переводит строку в верхний регистр.
const toUpper = s => s.toUpperCase();
### Instruction: Напишите на JavaScript функцию, которая переводит строку в верхний регистр. ### Response: const toUpper = s => s.toUpperCase();
69,694,589
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;
81,782,332
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('');
37,102,310
en
C#
array_ops
intermediate
Write a function that reverses a list in C#.
public void Reverse(int[] arr) { System.Array.Reverse(arr); }
### Instruction: Write a function that reverses a list in C#. ### Response: public void Reverse(int[] arr) { System.Array.Reverse(arr); }
33,656,246
kk
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; }
15,576,485
en
C#
logic_ops
intermediate
Write a function that determines if the number 267 is prime in C#.
public bool IsPrime() { int n = 267; 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 267 is prime in C#. ### Response: public bool IsPrime() { int n = 267; if (n <= 1) return false; for (int i = 2; i * i <= n; i++) if (n % i == 0) return false; return true; }
263,349
en
C#
factorial
advanced
Write a function in C# that calculates the factorial of 2890.
static long Factorial(int n) { return n <= 1 ? 1 : n * Factorial(n - 1); } Console.WriteLine(Factorial(2890));
### Instruction: Write a function in C# that calculates the factorial of 2890. ### Response: static long Factorial(int n) { return n <= 1 ? 1 : n * Factorial(n - 1); } Console.WriteLine(Factorial(2890));
35,849,884
ru
Python
array_ops
advanced
Напишите на Python функцию, которая разворачивает список задом наперед.
def reverse_list(arr): return arr[::-1]
### Instruction: Напишите на Python функцию, которая разворачивает список задом наперед. ### Response: def reverse_list(arr): return arr[::-1]
3,861,565
ru
Java
var_decl
beginner
Как объявить переменную result со значением 784093 в Java?
int result = 784093;
### Instruction: Как объявить переменную result со значением 784093 в Java? ### Response: int result = 784093;
54,366,762
ru
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; }
36,975,318
ru
Java
logic_ops
intermediate
Напишите на Java логику проверки, является ли год 1991 високосным.
public bool IsLeap() { int y = 1991; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
### Instruction: Напишите на Java логику проверки, является ли год 1991 високосным. ### Response: public bool IsLeap() { int y = 1991; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
61,446,789
en
Python
logic_ops
intermediate
Write a function that determines if the number 420 is prime in Python.
def is_prime(): n = 420 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 420 is prime in Python. ### Response: def is_prime(): n = 420 return n > 1 and all(n % i != 0 for i in range(2, int(n**0.5) + 1))
4,150,437
ru
C++
var_decl
beginner
Как объявить переменную data со значением 189666 в C++?
int data = 189666;
### Instruction: Как объявить переменную data со значением 189666 в C++? ### Response: int data = 189666;
40,401,239
kk
Python
string_ops
advanced
Python тилінде жолды жоғарғы регистрге ауыстыратын функцияны жазыңыз.
def to_upper(s): return s.upper()
### Instruction: Python тилінде жолды жоғарғы регистрге ауыстыратын функцияны жазыңыз. ### Response: def to_upper(s): return s.upper()
50,683,056
en
Unity
array_ops
advanced
Write a function that finds the maximum number in an array in Unity.
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 Unity. ### Response: public int GetMax(int[] arr) { int max = arr[0]; foreach(int x in arr) if(x > max) max = x; return max; }
73,249,344
en
Python
array_ops
intermediate
Write a function that filters only even numbers from a list in Python.
def filter_even(arr): return [x for x in arr if x % 2 == 0]
### Instruction: Write a function that filters only even numbers from a list in Python. ### Response: def filter_even(arr): return [x for x in arr if x % 2 == 0]
76,225,324
ru
Python
string_ops
intermediate
Напишите на Python функцию, которая переводит строку в верхний регистр.
def to_upper(s): return s.upper()
### Instruction: Напишите на Python функцию, которая переводит строку в верхний регистр. ### Response: def to_upper(s): return s.upper()
1,746,035
ru
C++
var_decl
beginner
Как объявить переменную buffer со значением 793708 в C++?
int buffer = 793708;
### Instruction: Как объявить переменную buffer со значением 793708 в C++? ### Response: int buffer = 793708;
12,353,701
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; }
821,149
en
C#
var_decl
beginner
How to declare a variable total with value 826963 in C#?
int total = 826963;
### Instruction: How to declare a variable total with value 826963 in C#? ### Response: int total = 826963;
35,381,697
en
Python
logic_ops
advanced
Write logic to check if the year 2043 is a leap year in Python.
def is_leap(): year = 2043 return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0)
### Instruction: Write logic to check if the year 2043 is a leap year in Python. ### Response: def is_leap(): year = 2043 return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0)
539,428
ru
C#
var_decl
beginner
Как объявить переменную amount со значением 859917 в C#?
int amount = 859917;
### Instruction: Как объявить переменную amount со значением 859917 в C#? ### Response: int amount = 859917;
2,562,244
kk
Unity
var_decl
beginner
Unity тілінде 904196 мәнімен amount айнымалысын қалай жариялауға болады?
int amount = 904196;
### Instruction: Unity тілінде 904196 мәнімен amount айнымалысын қалай жариялауға болады? ### Response: int amount = 904196;
78,209,728
en
Unity
string_ops
advanced
Write a function that converts a string to uppercase in Unity.
public string ToUpper(string s) { return s.ToUpper(); }
### Instruction: Write a function that converts a string to uppercase in Unity. ### Response: public string ToUpper(string s) { return s.ToUpper(); }
2,140,412
ru
Java
var_decl
beginner
Как объявить переменную weight со значением 417634 в Java?
int weight = 417634;
### Instruction: Как объявить переменную weight со значением 417634 в Java? ### Response: int weight = 417634;
44,855,137
ru
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; }
2,252,118
kk
JavaScript
var_decl
beginner
JavaScript тілінде 567246 мәнімен health айнымалысын қалай жариялауға болады?
let health = 567246;
### Instruction: JavaScript тілінде 567246 мәнімен health айнымалысын қалай жариялауға болады? ### Response: let health = 567246;
14,259,217
ru
JavaScript
array_ops
advanced
Напишите на JavaScript функцию, которая разворачивает список задом наперед.
const reverseArr = arr => arr.reverse();
### Instruction: Напишите на JavaScript функцию, которая разворачивает список задом наперед. ### Response: const reverseArr = arr => arr.reverse();
84,182,185
kk
Java
array_ops
intermediate
Java тилінде жиымдағы ең үлкен санды табатын функцияны жазыңыз.
public int GetMax(int[] arr) { int max = arr[0]; foreach(int x in arr) if(x > max) max = x; return max; }
### Instruction: Java тилінде жиымдағы ең үлкен санды табатын функцияны жазыңыз. ### Response: public int GetMax(int[] arr) { int max = arr[0]; foreach(int x in arr) if(x > max) max = x; return max; }
16,562,337
ru
JavaScript
logic_ops
advanced
Напишите на JavaScript функцию, определяющую, является ли число 108 простым.
function isPrime() { let n = 108; if (n <= 1) return false; for (let i = 2; i * i <= n; i++) if (n % i === 0) return false; return true; }
### Instruction: Напишите на JavaScript функцию, определяющую, является ли число 108 простым. ### Response: function isPrime() { let n = 108; if (n <= 1) return false; for (let i = 2; i * i <= n; i++) if (n % i === 0) return false; return true; }
86,369,597
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(); }
15,206,544
ru
Python
array_ops
advanced
Напишите на Python функцию, которая находит максимальное число в массиве.
def get_max(arr): return max(arr)
### Instruction: Напишите на Python функцию, которая находит максимальное число в массиве. ### Response: def get_max(arr): return max(arr)
16,928,854
en
Java
logic_ops
advanced
Write a function that determines if the number 335 is prime in Java.
public bool IsPrime() { int n = 335; 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 335 is prime in Java. ### Response: public bool IsPrime() { int n = 335; if (n <= 1) return false; for (int i = 2; i * i <= n; i++) if (n % i == 0) return false; return true; }
2,037,969
ru
JavaScript
var_decl
beginner
Как объявить переменную y со значением 259072 в JavaScript?
let y = 259072;
### Instruction: Как объявить переменную y со значением 259072 в JavaScript? ### Response: let y = 259072;
56,500,639
kk
Unity
array_ops
advanced
Unity тилінде тізімнен тек жұп сандарды сүзетін функцияны жазыңыз.
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: Unity тилінде тізімнен тек жұп сандарды сүзетін функцияны жазыңыз. ### 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; }
33,717,731
kk
JavaScript
array_ops
advanced
JavaScript тилінде тізімді керісінше айналдыратын функцияны жазыңыз.
const reverseArr = arr => arr.reverse();
### Instruction: JavaScript тилінде тізімді керісінше айналдыратын функцияны жазыңыз. ### Response: const reverseArr = arr => arr.reverse();
46,980,710
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); }
61,461,744
kk
JavaScript
array_ops
advanced
JavaScript тилінде тізімді керісінше айналдыратын функцияны жазыңыз.
const reverseArr = arr => arr.reverse();
### Instruction: JavaScript тилінде тізімді керісінше айналдыратын функцияны жазыңыз. ### Response: const reverseArr = arr => arr.reverse();
2,636,359
ru
C++
var_decl
beginner
Как объявить переменную timer со значением 534315 в C++?
int timer = 534315;
### Instruction: Как объявить переменную timer со значением 534315 в C++? ### Response: int timer = 534315;
466,793
en
Python
var_decl
beginner
How to declare a variable timer with value 366496 in Python?
timer = 366496
### Instruction: How to declare a variable timer with value 366496 in Python? ### Response: timer = 366496
3,880,765
kk
Java
var_decl
beginner
Java тілінде 914813 мәнімен timer айнымалысын қалай жариялауға болады?
int timer = 914813;
### Instruction: Java тілінде 914813 мәнімен timer айнымалысын қалай жариялауға болады? ### Response: int timer = 914813;
43,692,934
en
C++
logic_ops
advanced
Write logic to check if the year 1931 is a leap year in C++.
public bool IsLeap() { int y = 1931; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
### Instruction: Write logic to check if the year 1931 is a leap year in C++. ### Response: public bool IsLeap() { int y = 1931; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
94,021,064
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; }
51,546,044
en
Unity
logic_ops
advanced
Write logic to check if the year 1952 is a leap year in Unity.
public bool IsLeap() { int y = 1952; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
### Instruction: Write logic to check if the year 1952 is a leap year in Unity. ### Response: public bool IsLeap() { int y = 1952; return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0); }
88,780,222
kk
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аеёиоуыэюя')
75,634,089
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(); }
2,756,258
kk
C#
var_decl
beginner
C# тілінде 932587 мәнімен data айнымалысын қалай жариялауға болады?
int data = 932587;
### Instruction: C# тілінде 932587 мәнімен data айнымалысын қалай жариялауға болады? ### Response: int data = 932587;
79,605,808
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; }
1,078,267
en
Python
var_decl
beginner
How to declare a variable value with value 767065 in Python?
value = 767065
### Instruction: How to declare a variable value with value 767065 in Python? ### Response: value = 767065
71,162,288
ru
Python
array_ops
intermediate
Напишите на Python функцию, которая разворачивает список задом наперед.
def reverse_list(arr): return arr[::-1]
### Instruction: Напишите на Python функцию, которая разворачивает список задом наперед. ### Response: def reverse_list(arr): return arr[::-1]
61,449,658
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; }
94,417,915
kk
Unity
logic_ops
advanced
Unity тилінде 172 санының жай сан екенін анықтайтын функцияны жазыңыз.
public bool IsPrime() { int n = 172; if (n <= 1) return false; for (int i = 2; i * i <= n; i++) if (n % i == 0) return false; return true; }
### Instruction: Unity тилінде 172 санының жай сан екенін анықтайтын функцияны жазыңыз. ### Response: public bool IsPrime() { int n = 172; if (n <= 1) return false; for (int i = 2; i * i <= n; i++) if (n % i == 0) return false; return true; }
5,167
ru
Unity
factorial
advanced
Напиши функцию на Unity, которая вычисляет факториал числа 1439.
long Factorial(int n) { return n <= 1 ? 1 : n * Factorial(n - 1); } void Start() { Debug.Log(Factorial(1439)); }
### Instruction: Напиши функцию на Unity, которая вычисляет факториал числа 1439. ### Response: long Factorial(int n) { return n <= 1 ? 1 : n * Factorial(n - 1); } void Start() { Debug.Log(Factorial(1439)); }
63,665,041
ru
Python
logic_ops
advanced
Напишите на Python логику проверки, является ли год 2070 високосным.
def is_leap(): year = 2070 return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0)
### Instruction: Напишите на Python логику проверки, является ли год 2070 високосным. ### Response: def is_leap(): year = 2070 return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0)
2,477,395
ru
JavaScript
var_decl
beginner
Как объявить переменную index со значением 495921 в JavaScript?
let index = 495921;
### Instruction: Как объявить переменную index со значением 495921 в JavaScript? ### Response: let index = 495921;
41,015,622
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; }
49,954,673
en
Java
logic_ops
intermediate
Write a function that determines if the number 115 is prime in Java.
public bool IsPrime() { int n = 115; 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 115 is prime in Java. ### Response: public bool IsPrime() { int n = 115; if (n <= 1) return false; for (int i = 2; i * i <= n; i++) if (n % i == 0) return false; return true; }
84,630,371
kk
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; }