Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="library.js"></script>
</head>
<body>
<div>
<h3>Search Product by Type</h3>
/*
Reverse a doubly linked list, input list may also be empty
Node is defined as
struct Node
{
int data;
Node *next;
Node *prev;
}
*/
/*
Reverse a linked list and return pointer to the head
The input list will have at least one element
Node is defined as
struct Node
{
int data;
struct Node *next;
}
*/
<?php
// Import PHPMailer classes into the global namespace
// These must be at the top of your script, not inside a function
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
//Load composer's autoloader
require 'vendor/autoload.php';
$mail = new PHPMailer(true); // Passing true enables exceptions
@byron-perez
byron-perez / check.cpp
Last active February 11, 2018 20:20
ways to give a check
#include <bits/stdc++.h>
using namespace std;
vector<int> findBlackKing(vector < vector<char> > board)
{
int board_len = board.size();
vector<int> king_pos;
for(int x = 0; x < board_len; x++)
{
@byron-perez
byron-perez / check.cpp
Created February 8, 2018 22:01
ways to give a check
#include <bits/stdc++.h>
using namespace std;
vector<int> findBlackKing(vector < vector<char> > board)
{
int board_len = board.size();
vector<int> king_pos;
for(int x = 0; x < board_len; x++)
{
#include <bits/stdc++.h>
using namespace std;
int numDigits(int number)
{
int digits = 0;
if (number < 0) digits = 1; // remove this line if '-' counts as a digit
while (number) {
number /= 10;
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
#!/bin/python3
import sys
#functions
def bsearch(x, L):
if x == L[len(L) // 2]:
return True
if (len(L) // 2) == 0:
return False
#!/bin/python3
import sys
#functions
def BFS(G, s):
explored = []
queue = [s]