Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Collections.Generic;
using System.Linq;
namespace ConsoleApp2
{
public static class Solution
{
private static readonly Dictionary<int, IEnumerable<string>> NumbersToLetters = new()
{
@HELLoWorlD01100
HELLoWorlD01100 / Solution.cs
Created May 2, 2021 23:03
Tricky multiplication of array elements
using System;
using System.Collections.Generic;
using System.Linq;
namespace ConsoleApp1
{
public static class Solution
{
public static IEnumerable<int> MultiplyElementsExceptSelf(int[] source)
{
@HELLoWorlD01100
HELLoWorlD01100 / Algorithm.cs
Created April 25, 2021 21:05
Arithmetic Progression Without One Element
using System;
using System.Collections.Generic;
using System.Linq;
namespace ArithmeticProgression
{
public class Algorithm
{
private int _step;
public int Run(int[] arithmeticProgression)
@HELLoWorlD01100
HELLoWorlD01100 / Solve.cs
Created March 28, 2021 16:12
FindNextGreater
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
namespace ConsoleApp
{
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace RomanNumbers
{
public class RomanNumber
{
public string Value { get; }
namespace SudokuSolverTests
{
public static class SudokuCollection
{
public static char[,] Sudoku1 =
{
{'4', '2', '.', '.', '.', '3', '.', '8', '1'},
{'.', '.', '1', '.', '.', '.', '.', '.', '3' },
{'.', '7', '8', '.', '1', '5', '.', '6', '9' },
{'.', '.', '.', '6', '.', '.', '.', '3', '5' },
@HELLoWorlD01100
HELLoWorlD01100 / Solution.cs
Created March 7, 2021 13:15
Контейнер с наибольшим объемом
using System;
namespace ConsoleApp1
{
public static class Solution
{
public static int FindMaxArea(int[] heights)
{
var leftIndex = 0;
var rightIndex = heights.Length - 1;
@HELLoWorlD01100
HELLoWorlD01100 / Solution.cs
Last active February 27, 2021 08:16
Минимальное количество операций
namespace ConsoleApp
{
public static class Solution
{
public static int FindMinOperationCount(int from, int to)
{
if (from == to)
return 0;
if (from > to)
@HELLoWorlD01100
HELLoWorlD01100 / EnumerableExtensions.cs
Created February 21, 2021 10:06
Гармоническая подпоследовательность
using System.Collections.Generic;
using System.Linq;
namespace ConsoleApp1
{
public static class EnumerableExtensions
{
public static IDictionary<T, int> GetFrequency<T>(this IEnumerable<T> enumerable)
{
return enumerable
@HELLoWorlD01100
HELLoWorlD01100 / Solution.cs
Created February 13, 2021 10:12
Кратчайшее расстояние до заданного символа
using System;
namespace ConsoleApp
{
public class Solution
{
public static int[] GetShortestDistanceToChar(string text, char ch)
{
var indexOfChar = text.IndexOf(ch);