Skip to content

Instantly share code, notes, and snippets.

View Ezeji's full-sized avatar

Franklin Ezeji Ezeji

View GitHub Profile
@Ezeji
Ezeji / NIbssistitutionlist
Created March 27, 2023 20:25 — forked from OlabodeAbesin/NIbssistitutionlist
Nigerian bank, bank/institution codes and logo
[
{
"id": 376,
"InstitutionCode": "090270",
"InstitutionName": "AB MICROFINANCE BANK",
"Category": "9",
"dump": null,
"created_at": "2020-03-02 20:44:54",
"updated_at": "2020-08-24 00:02:52",
"deleted_at": null,
@Ezeji
Ezeji / GetMinimumUmbrellas.cs
Created November 13, 2021 18:47
The monsoon umbrellas algorithm finds the minimum number of umbrellas that can cover a given number of people and no more.
using System;
using System.Collections.Generic;
namespace Monsoon_Umbrellas_Algorithm
{
class Program
{
public static int GetMinimumUmbrellas(int[] sizes, int requirement)
{
@Ezeji
Ezeji / guid-sql-server.sql
Created September 20, 2021 21:21 — forked from akkidas/guid-sql-server.sql
Generate New Guid (uniqueidentifier) in SQL Server
-- If you want to generate a new Guid (uniqueidentifier) in SQL server the you can simply use the NEWID() function.
SELECT NEWID()
GO
-- This will return a new random uniqueidentifier e.g.
E75B92A3-3299-4407-A913-C5CA196B3CAB
To select this Guid in in a variable
--assign uniqueidentifier in a variable
DECLARE @EmployeeID uniqueidentifier
@Ezeji
Ezeji / FirstPossibleCombinations.cs
Created May 29, 2021 20:41
This algorithm finds a possible combination for digits between 2-9 on a phone which are mapped to specific alphabets.
class Program
{
private static readonly string[] two = { "a","b","c" };
private static readonly string[] three = { "d", "e", "f" };
private static readonly string[] four = { "g", "h", "i" };
private static readonly string[] five = { "j", "k", "l" };
private static readonly string[] six = { "m", "n", "o" };
private static readonly string[] seven = { "p", "q", "r", "s" };
private static readonly string[] eight = { "t", "u", "v" };
private static readonly string[] nine = { "w", "x", "y", "z" };
@Ezeji
Ezeji / MinimiumTimeDifference.cs
Created May 23, 2021 21:09
This algorithm finds the minimum time difference between any two times in an array.
class Program
{
private static List<string> MinutesArray { get; set; } = new List<string>();
static void Main(string[] args)
{
string[] timeArray = { "16:15", "16:00", "12:20" };
GetMinutesFromTimeArrayIntoMinutesArray(timeArray);
var result = MinimiumTimeDifference(MinutesArray);
@Ezeji
Ezeji / ShufflePupils.cs
Created May 15, 2021 11:37
This algorithm shuffle pupils on an assembly line by moving a number of pupils either to the front of the line or to the end of the line.
class Program
{
private static List<int> Result { get; set; } = new List<int>();
static void Main(string[] args)
{
int[] nums = { 4, 1, 3 };
int val = -1;
ShufflePupils(nums, val);
@Ezeji
Ezeji / MergeArraysInIncreasingOrder.cs
Last active May 12, 2021 18:11
This algorithm focuses on merging two arrays and sorting them in increasing order.
class Program
{
private static List<int> SingleArray { get; set; } = new List<int>();
static void Main(string[] args)
{
int[] classA = { 13, 15, 19 };
int[] classB = { 11, 13, 18 };
AddFirstArrayIntoSingleArray(classA);
@Ezeji
Ezeji / ArrayProducts.cs
Last active May 2, 2021 16:44
This algorithm focuses on finding the product of array elements.
class Program
{
private static int TotalNumber { get; set; }
private static List<int> Result { get; set; } = new List<int>();
static void Main(string[] args)
{
TotalNumber = 1;
int[] nums = { 4, 5, 10, 2 };
@Ezeji
Ezeji / NumberPositionInArray.cs
Last active April 27, 2021 03:54
This algorithm focuses on finding the position of a number in a sorted array.
class Program
{
private static List<int> ResultWhenValIsInArray { get; set; } = new List<int>();
private static List<int> ResultWhenValIsNotInArray { get; set; }
static void Main(string[] args)
{
ResultWhenValIsInArray.Add(-1);
ResultWhenValIsInArray.Add(-1);
@Ezeji
Ezeji / RemoveNumberInstances.cs
Created April 16, 2021 23:05
This algorithm focuses on removing number instances.
public static int RemoveNumberInstances(int[] nums, int val)
{
if (nums == null)
{
return 0;
}
else
{
nums = nums.Where(arrayElement => arrayElement != val).ToArray();