Skip to content

Instantly share code, notes, and snippets.

@schauhan232
schauhan232 / Minimum and Miximum from given array
Created July 6, 2021 11:52
GeeksForGeeks: Program to find the minimum and maximum element of an array
class Program
{
public static void Main(string[] args)
{
int[] userInputArray = { 12, 1234, 45, 67, 1 };
Console.WriteLine(MinimumValue(userInputArray));
Console.WriteLine(MaximumValue(userInputArray));
Console.Read();
}
@schauhan232
schauhan232 / Check if a key is present in every segment of size k in an array
Created July 6, 2021 10:44
GeeksForGeeks - Check if a key is present in every segment of size k in an array C#
class Program
{
public static void Main(string[] args)
{
int[] userInputArray = { 21, 23, 56, 65, 34, 54, 76, 32, 23, 45, 21, 23, 25 } ;
int userAskedNumberToBeFind = 23;
int segment = 5;
var output = "NO";
@schauhan232
schauhan232 / Grading Students
Created July 6, 2021 09:59
HackerRank Grading Students
/*
* Complete the 'gradingStudents' function below.
*
* The function is expected to return an INTEGER_ARRAY.
* The function accepts INTEGER_ARRAY grades as parameter.
*/
public static List<int> gradingStudents(List<int> grades)
{
return grades.Select(grade=>{
@schauhan232
schauhan232 / HackerRank Day 1 - C# "Data Types"
Last active July 5, 2021 13:14
HackerRank Day 1 - C# "Data Types"
using System;
using System.Collections.Generic;
using System.IO;
class Solution {
static void Main(String[] args) {
int i = 4;
double d = 4.0;
string s = "HackerRank ";
@schauhan232
schauhan232 / HttpClientExtensions.cs
Last active March 21, 2023 11:06
Http Extension methods/Http Helper to get Response/ Request serialized and detribalized
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading;
using System.Threading.Tasks;