C# (C Sharp) programming
По всем вопросам- @notxxx1 Реестр РКН: https://clck.ru/3Fk3kb #VRHSZ
Show more📈 Analytical overview of Telegram channel C# (C Sharp) programming
Channel C# (C Sharp) programming (@csharp_ci) in the Russian language segment is an active participant. Currently, the community unites 18 307 subscribers, ranking 7 335 in the Technologies & Applications category and 36 870 in the Russia region.
📊 Audience metrics and dynamics
Since its creation on невідомо, the project has demonstrated rapid growth, gathering an audience of 18 307 subscribers.
According to the latest data from 15 June, 2026, the channel demonstrates stable activity. Although there has been a change in the number of participants by -14 over the last 30 days and by 0 over the last 24 hours, overall reach remains high.
- Verification status: Not verified
- Engagement rate (ER): The average audience engagement rate is 19.46%. Within the first 24 hours after publication, content typically collects 7.27% reactions from the total number of subscribers.
- Post reach: On average, each post receives 3 563 views. Within the first day, a publication typically gains 1 331 views.
- Reactions and interaction: The audience actively supports content: the average number of reactions per post is 0.
- Thematic interests: Content is focused on key topics such as .net, api, логика, архитектура, string.
📝 Description and content policy
The author describes the resource as a platform for expressing subjective opinions:
“По всем вопросам- @notxxx1
Реестр РКН: https://clck.ru/3Fk3kb
#VRHSZ”
Thanks to the high frequency of updates (latest data received on 16 June, 2026), the channel maintains relevance and a high level of publication reach. Analytics show that the audience actively interacts with content, making it an important point of influence in the Technologies & Applications category.
root1 = [1,3,2,5], root2 = [2,1,3,null,4,null,7]
Вывод:[3,4,5,5,4,null,7]
Ввод: root1 = [1], root2 = [1,2]
Вывод: [2,2]
* Определение для узла двоичного дерева.
* public class TreeNode {
* public int val;
* public TreeNode left;
* public TreeNode right;
* public TreeNode(int val=0, TreeNode left=null, TreeNode right=null) {
* this.val = val;
* this.left = left;
* this.right = right;
* }
* }
*/
public class Solution {
public TreeNode MergeTrees(TreeNode root1, TreeNode root2)
{
if (root1 == null & root2 == null) return null;
if (root1 == null) return root2;
if (root2 == null) return root1;
var left = MergeTrees(root1.left, root2.left);
var right = MergeTrees(root1.right, root2.right);
if (root1.left != left) root1.left = left;
if (root1.right != right) root1.right = right;
root1.val += root2.val;
return root1;
}
}
Пишите свое мнение в комментариях👇
@csharp_ciPS> Install-Package ArchUnitNET
▪ Github
▪Документация
@csharp_ciusing System;
using System.Linq;
public class Program {
public static void Main() {
Console.WriteLine(Enumerable.Range(1, 100).Sum());
}
}
▪Применение функции ко всем числам в списке:
using System;
using System.Linq;
public class Program {
private static int Square(int n) => n * n;
public static void Main() {
int[] arr = { 1, 2, 3, 4 };
// direct anonymous function
int[] arr2 = arr.Select(n => n * n).ToArray();
// using another method
int[] arr3 = arr.Select(Square).ToArray();
foreach (int n in arr2)
Console.WriteLine(n); // output: 1, 4, 9, 16
foreach (int n in arr3)
Console.WriteLine(n); // output: 1, 4, 9, 16
}
}
▪Фильтрация списка номеров:
using System;
using System.Linq;
public class Program {
private static bool IsValid(int n) => n % 2 == 0 && n > 4;
public static void Main() {
int[] arr = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
// direct anonymous function
int[] arr2 = arr.Where(n => n % 2 == 0 && n > 4).ToArray();
// using another method
int[] arr3 = arr.Where(IsValid).ToArray();
foreach (int n in arr2)
Console.WriteLine(n); // output: 6, 8
foreach (int n in arr3)
Console.WriteLine(n); // output: 6, 8
}
}
▪Нахождение минимального/максимального значения в списке:
using System;
using System.Linq;
public class Program {
public static void Main() {
int[] arr = { 4, 7, 2, 1, 3, 6, 9, 8, 0, 5 };
Console.WriteLine(Enumerable.Min(arr)); // output: 0
Console.WriteLine(Enumerable.Max(arr)); // output: 9
}
}
@csharp_cipublic class Solution {
public int MaxAreaOfIsland(int[][] grid)
{
var best = 0;
var travelled = new bool[grid.Length][];
for (var i = 0; i < grid.Length; i++)
travelled[i] = new bool[grid[i].Length];
for (var i = 0; i < grid.Length; i++)
for (var j = 0; j < grid[0].Length; j++)
if (grid[i][j] == 1 && !travelled[i][j])
{
var q = ExploreIsland(grid, i, j, travelled);
best = Math.Max(best, q);
}
return best;
}
private int ExploreIsland(int[][] grid, int i, int j, bool[][] travelled)
{
if (i < 0 || j < 0 || i >= travelled.Length || j >= travelled[0].Length) return 0;
if (grid[i][j] == 0 || travelled[i][j]) return 0;
travelled[i][j] = true;
var north = ExploreIsland(grid, i + 1, j, travelled);
var west = ExploreIsland(grid, i, j - 1, travelled);
var east = ExploreIsland(grid, i, j + 1, travelled);
var south = ExploreIsland(grid, i - 1, j, travelled);
return north + west + east + south + 1;
}
}
Временная сложность : O(n^2*m^2)
Пространственная сложность: O(n∗m)
Пишите свое решение в комментариях👇
@cpluscsharpdynamic obj = 3; // здесь obj - целочисленное int
Console.WriteLine(obj); // 3
obj = "Hello world"; // obj - строка
Console.WriteLine(obj); // Hello world
obj = new Person("Tom", 37); // obj - объект Person
Console.WriteLine(obj); // Person { Name = Tom, Age = 37 }
record class Person(string Name, int Age);
Несмотря на то, что переменная x меняет тип своего значения несколько раз, данный код будет нормально работать. В этом использование типов dynamic отличается от применения ключевого слова var. Для переменной, объявленной с помощью ключевого слова var, тип выводится во время компиляции и затем во время выполнения больше не меняется.
Также можно найти общее между использованием dynamic и типом object. Если в предыдущем примере мы заменим dynamic на object: object x = 3;, то результат будет тот же. Однако и тут есть различия. Например:
object obj = 24;
dynamic dyn = 24;
obj += 4; // так нельзя
dyn += 4; // а так можно
На строке obj += 4; мы увидим ошибку, так как операция += не может быть применена к типам object и int. С переменной, объявленной как dynamic, это пройдет, так как ее тип будет известен только во время выполнения.
Еще одна отличительная особенность использования dynamic состоит в том, что это ключевое слово применяется не только к переменным, но и к свойствам и методам. Например:
class Person
{
public string Name { get;}
public dynamic Age { get; set; }
public Person(string name, dynamic age)
{
Name = name; Age = age;
}
// выводим зарплату в зависимости от переданного формата
public dynamic GetSalary(dynamic value, string format)
{
if (format == "string") return $"{value} euro";
else if (format == "int") return value;
else return 0.0;
}
public override string ToString() => $"Name: {Name} Age: {Age}";
}
В классе Person определено динамическое свойство Age, поэтому при задании значения этому свойству мы можем написать и person.Age=22, и person.Age="twenty-two". Оба варианта будут допустимыми. А через параметр age в конструкторе этому свойству можно передать любое значение.
Также есть метод GetSalary, который возвращает значение dynamic. Например, в зависимости от параметра мы можем вернуть или строковое представление суммы дохода или численное. Также метод принимает dynamic в качестве параметра. Таким образом, мы можем передать в качестве значения дохода как целое, так и дробное число или строку. Посмотрим на конкретное применение:
dynamic tom = new Person("Tom", 22);
Console.WriteLine(tom);
Console.WriteLine(tom.GetSalary(28, "int"));
dynamic bob = new Person("Bob", "twenty-two");
Console.WriteLine(bob);
Console.WriteLine(bob.GetSalary("twenty-eight", "string"));
Консольный вывод программы:
Name: Tom Age: 22
28
Name: Bob Age: twenty-two
twenty-eight euro
@csharp_ci
Available now! Telegram Research 2025 — the year's key insights 
