Skip to content

Instantly share code, notes, and snippets.

View Strelok78's full-sized avatar

Shota Strelok78

View GitHub Profile
namespace iJuniorPractice
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine(ReadInt());
}
static int ReadInt()
@Strelok78
Strelok78 / iJunior_C#_Lesson_45
Last active May 8, 2025 16:21
Check open and close brackets correctness and max nesting depth
namespace CodeWarsExercises
{
class Program
{
static void Main(string[] args)
{
string symbols = "(()))))))(()))((((((";
char openBracket = '(';
char closeBracket = ')';
int maxNestingCount = 0;
@Strelok78
Strelok78 / iJunior_C#_Lesson_44
Last active May 7, 2025 15:56
Shift values in array to left on value entered by user
namespace iJuniorPractice
{
class Program
{
static void Main(string[] args)
{
int[] numbers = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
int shiftLeftValue;
int shiftsCount;
@Strelok78
Strelok78 / iJunior_C#_Lesson_43
Last active May 7, 2025 12:14
String.Split, split string by space
namespace iJuniorPractice
{
class Program
{
static void Main(string[] args)
{
string text = "In moonlit woods, whispers of ancient tales danced " +
"\n" +
"\n " +
"with shadows, weaving dreams beneath stars' gentle, timeless gaze.";
@Strelok78
Strelok78 / iJunior_C#_Lesson_42
Created May 5, 2025 15:37
sort array (bubble sort)
using System;
namespace iJuniorPractice
{
class Program
{
static void Main(string[] args)
{
int[] numbers = {1, 7, 3, 42, 52, 9, 19, 17, 21, 0, 1, 200};
int temp;
@Strelok78
Strelok78 / iJunior_C#_Lesson_41
Last active May 2, 2025 11:44
get number frequently repeated
using System;
namespace iJuniorPractice
{
class Program
{
static void Main(string[] args)
{
int[] numbers = {7, 7, 7, 42, 42, 9, 19, 19, 19, 31,
31, 64, 64, 64, 12, 12, 26, 53, 53, 53,
@Strelok78
Strelok78 / iJunior_C#_Lesson_40
Last active April 29, 2025 14:39
Get sum of dinamicaly changed array without LINQ and array.resize
using System;
namespace iJuniorPractice
{
class Program
{
static void Main(string[] args)
{
const string SumCommand = "sum";
const string ExitCommand = "exit";
@Strelok78
Strelok78 / iJunior_C#_Lesson_39
Last active April 29, 2025 13:34
Find local max values (value bigger than it's neighbours - edge values compare to it's only neighbour)
using System.Collections;
using System.Diagnostics;
using System.Text;
namespace iJuniorPractice;
class Program
{
static void Main(string[] args)
{
@Strelok78
Strelok78 / iJunior_C#_Lesson_38
Last active April 29, 2025 11:03
get max value in two dimensional array and replace with zero
using System.Collections;
using System.Diagnostics;
using System.Text;
namespace iJuniorPractice;
class Program
{
static void Main(string[] args)
{
@Strelok78
Strelok78 / iJunior_C#_Lesson_37
Last active April 28, 2025 14:19
get first line multiple and sum second line in two dimensional array of int
using System;
namespace iJuniorPractice
{
class Program
{
static void Main(string[] args)
{
int[,] numbers =
{