This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace ConsoleApp2 | |
{ | |
public static class Solution | |
{ | |
private static readonly Dictionary<int, IEnumerable<string>> NumbersToLetters = new() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace ConsoleApp1 | |
{ | |
public static class Solution | |
{ | |
public static IEnumerable<int> MultiplyElementsExceptSelf(int[] source) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace ArithmeticProgression | |
{ | |
public class Algorithm | |
{ | |
private int _step; | |
public int Run(int[] arithmeticProgression) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Runtime.CompilerServices; | |
using BenchmarkDotNet.Attributes; | |
using BenchmarkDotNet.Running; | |
namespace ConsoleApp | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace RomanNumbers | |
{ | |
public class RomanNumber | |
{ | |
public string Value { get; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace ConsoleApp1 | |
{ | |
public static class Solution | |
{ | |
public static int FindMaxArea(int[] heights) | |
{ | |
var leftIndex = 0; | |
var rightIndex = heights.Length - 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace ConsoleApp | |
{ | |
public static class Solution | |
{ | |
public static int FindMinOperationCount(int from, int to) | |
{ | |
if (from == to) | |
return 0; | |
if (from > to) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace ConsoleApp | |
{ | |
public class Solution | |
{ | |
public static int[] GetShortestDistanceToChar(string text, char ch) | |
{ | |
var indexOfChar = text.IndexOf(ch); |
NewerOlder