Skip to content

Instantly share code, notes, and snippets.

View didagu's full-sized avatar
😊
Creating Something EPIC !!

IDAGU DOMINIC IDOKO didagu

😊
Creating Something EPIC !!
View GitHub Profile
@didagu
didagu / sudoku-solver.js
Created March 20, 2020 16:18
Simple Sudoku Solver using Back-Tracking Algorithm - Javascript version
const board = [
[5, 3, 0, 0, 7, 0, 0, 0, 0],
[6, 0, 0, 1, 9, 5, 0, 0, 0],
[0, 9, 8, 0, 0, 0, 0, 6, 0],
[8, 0, 0, 0, 6, 0, 0, 0, 3],
[4, 0, 0, 8, 0, 3, 0, 0, 1],
[7, 0, 0, 0, 2, 0, 0, 0, 6],
[0, 6, 0, 0, 0, 0, 2, 8, 0],
[0, 0, 0, 4, 1, 9, 0, 0, 5],
[0, 0, 0, 0, 8, 0, 0, 7, 9]
@didagu
didagu / sudoku-solver.php
Created March 20, 2020 16:09
Simple Sudoku Solver using Back-Tracking Algorithm
<?php
$board = [
[5, 3, 0, 0, 7, 0, 0, 0, 0],
[6, 0, 0, 1, 9, 5, 0, 0, 0],
[0, 9, 8, 0, 0, 0, 0, 6, 0],
[8, 0, 0, 0, 6, 0, 0, 0, 3],
[4, 0, 0, 8, 0, 3, 0, 0, 1],
[7, 0, 0, 0, 2, 0, 0, 0, 6],
[0, 6, 0, 0, 0, 0, 2, 8, 0],
[0, 0, 0, 4, 1, 9, 0, 0, 5],
@didagu
didagu / sumStrings.php
Last active March 17, 2020 07:12
function that returns the string representation of the sum of those integers
<?php
function sumStrings($string1,$string2) {
$result = (int) $string1 + (int) $string2;
return (string) $result;
}
/*
* input: $string1 = "1", $string2 = "2"
*/
@didagu
didagu / getOddOccurenceFromArray.php
Last active March 16, 2020 23:59
function that gets the item that occurred an odd number of times in an array.
<?php
// first solution
function getOddOccurrenceFromArray1($arr)
{
$result = 0;
for ($i = 0; $i < sizeof($arr); $i++)
/*
* Using xor bitwise operator, the final value of $result will
* be the array item that occurred an odd number of time
$url="https://checkout.simplepay.ng/v2/payments/form/";
$fields=array('key'=>'test_pu_18fb91d02d7c4be5a386309c882bd176',
'description'=>'holla i am here',
'payment_type'=>'checkout' ,
'amount' => $subtotal,
'email' => $email,
'currency'=>'NGN',
'payment_id'=>'XVTID',
'success_url'=>'http://localhost/tender/tender/epayments/confirmation',
'cancel_url'=>'http://localhost/tender/tender/epayments/confirmation',
@didagu
didagu / 0_reuse_code.js
Created February 2, 2017 09:49
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console