-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
219 lines (173 loc) · 5.65 KB
/
Program.cs
File metadata and controls
219 lines (173 loc) · 5.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
// See https://aka.ms/new-console-template for more information
//https://www.w3schools.com/dsa/dsa_data_arrays.php
using System.Collections.Immutable;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Collections.Generic;
using DataStructureAlgorithm.Topic;
using DataStructureAlgorithm.Problems;
using DataStructureAlgorithm;
using DataStructureAlgorithm.Hackerrank;
using DataStructureAlgorithm.LeetCode;
using DataStructureAlgorithm.LeetCode.ArrayString;
using DataStructureAlgorithm.LeetCode.TwoPointers;
using DataStructureAlgorithm.LeetCode.SlidingWindow;
using DataStructureAlgorithm.LeetCode.PrefixSum;
using DataStructureAlgorithm.LeetCode.HashMap;
using DataStructureAlgorithm.LeetCode.Stake;
using DataStructureAlgorithm.LeetCode.Queue;
using DataStructureAlgorithm.LeetCode.LinkedList;
//// Fibonakki Series By Loop
//var val1 = 0;
//var val2 = 1;
//System.Console.WriteLine(val1);
//System.Console.WriteLine(val2);
//for (var i = 0; i < 18; i++)
//{
// var fibo = val2 + val1;
// System.Console.WriteLine(fibo);
// val1 = val2;
// val2 = fibo;
//}
//// Fibonakki Series By recursive
//int nCount = 2;
//void fibbonakki(int val1,int val2)
//{
// if (nCount <= 19)
// {
// var fibo = val1 + val2;
// System.Console.WriteLine(fibo);
// nCount++;
// val1 = val2;
// val2 = fibo;
// fibbonakki(val1, val2);
// }
// else { return; }
//}
//System.Console.WriteLine(0);
//System.Console.WriteLine(1);
//fibbonakki(0, 1);
////Array: Find the lowest value.
//int[] ary = [2, 5, 45, 6, 7];
//var a=ary[0];
//for (int i = 0; i < ary.Length; i++)
//{
// if (ary[i] < a) { a = ary[i]; }
//}
//System.Console.WriteLine(a);
////Bubble Sort: Bubble Sort is an algorithm that sorts an array from the lowest value to the highest value.
//int[] my_array = [64, 34, 25, 12, 22, 11, 90, 5];
//var length=my_array.Length;
//for (int i = 0; i < length; i++)
//{
// for (int j = 0; j < length - i - 1; j++)
// {
// var item=my_array[j];
// var nextValue=my_array[(j+1)];
// if (item > nextValue)
// {
// my_array[j+1]=item;
// my_array[j]=nextValue;
// }
// }
//}
//for (int i = 0;i < length; i++)
//{
// System.Console.WriteLine(my_array[i]);
//}
//Selection Sort :https://www.w3schools.com/dsa/dsa_algo_selectionsort.php
//int[] my_array = [64, 34, 25, 12, 22, 11, 90, 5];
//var length = my_array.Length;
//get 2Sum
//int[] get2Sum(int[] arrayOfNum,int targetValue)
//{
// var lnth=arrayOfNum.Length;
// int[] result = [];
// for (int firstIndex = 0; firstIndex<lnth;firstIndex++)
// {
// var firstNumber=arrayOfNum[firstIndex];
// for (int secondIndex = firstIndex+1; secondIndex < lnth; secondIndex++)
// {
// var secondNumber=arrayOfNum[secondIndex];
// if(firstNumber+secondNumber==targetValue)
// {
// result = [firstNumber, secondNumber];
// }
// }
// }
// return result;
//}
//int[] get2SumV2(int[] arrayOfNum, int targetValue)
//{
// var lnth = arrayOfNum.Length;
// int[] result = [];
// int[] keep = [];
// for (int firstIndex = 0; firstIndex < lnth; firstIndex++)
// {
// var firstNumber = arrayOfNum[firstIndex];
// var secondnumber=targetValue-firstNumber;
// if (keep.Contains(secondnumber)){
// result = [firstNumber, secondnumber];
// break;
// }
// else
// {
// keep.Append(firstNumber);
// }
// }
// return result;
//}
//var result = get2Sum([1, 2, 3, 4, 5], 5);
//System.Console.WriteLine(String.Join(",",result));
/*************Deligates************/
//System.Console.WriteLine("Add: "+ MainDelegate.addition(2, 3)+". Minus:"+MainDelegate.deduction(5,2));
/*************TimeZone************/
//TimeZoneSettings.getNigeriaTime();
/********************Problems*************************/
//SearchingChallange.Execute();
//ValidParentheses.Execute();
/********************LeetCode Problems Executions***************/
//MergeSortedArray.ExecuteV1();
//MergeStringsAlternately.Execute();
//GreatestCommonDivisorOfStrings.Execute();
//KidsWithTheGreatestNumberOfCandies.Execute();
//CanPlaceFlowers.Execute();
//ReverseVowelsOfAString.Execute();
//ReverseWordsInString.Execute();
//ProductOfArrayExceptSelf.Execute();
//IncreasingTripletSubsequence.Execute();
//LeetCodeStringCompression.Execute();
//MoveZeros.Execute();
//Subsequence.Execute();
//ContainerWithMostWater.Execute();
//MaxNumberOfKSumPairs.Execute();
//MaximumAverageSubarrayI.Execute();
//MaxNumberOfVowels.Execute();
//MaxConsecutiveOnesIII.Execute();
//LongestSubArrayDeletingOneElement.Execute();
//FindTheHighestAltitude.Execute();
//FindPivotIndex.Execute();
//FindDifferenceOfTwoArray.Execute();
//UniqueNumberOfOccurrences.Execute();
//DetermineIfTwoStringsAreClose.Execute();
//EqualRowColumnPairs.Execute();
//RemovingStarsFromString.Execute();
//AsteroidCollision.Execute();
//DecodeString.Execute();
//RecentCounter recentCounter = new RecentCounter();
//Console.WriteLine(recentCounter.Ping(1)); // Output: 1
//Console.WriteLine(recentCounter.Ping(100)); // Output: 2
//Console.WriteLine(recentCounter.Ping(3001)); // Output: 3
//Console.WriteLine(recentCounter.Ping(3002)); // Output: 3
//Dota2Senate.Execute();
//DeleteMiddleNodeLinkedList.Execute();
//OddEvenLinkedList.Execute();
//ReverseLinkedList.Execute();
MaximumTwinSumLinkedList.Execute();
/********************Hacker Rank*********************/
//Triplet.Execute();
//BigSum.Execute();
//DiagonalDifference.ExecuteSum();
//PlusMinus.Execute();
//Staircase.staircase(6);
//MinnMaxSum.Execute();