Skip to content

Instantly share code, notes, and snippets.

/**
* Returns of max profit for the given market values
* it there are not possible to compleat the deal it will return 0
*
* @param $marketValues the array wit market values, should contain at least one value
* @return int
*/
function getMaxProfit($marketValues) : int
{
$minValue = $marketValues[array_keys($marketValues)[0]];
#include <Wire.h>
#include <Adafruit_INA219.h> // You will need to download this library
Adafruit_INA219 sensor219; // Declare and instance of INA219
void setup(void)
{
Wire.begin(13, 15); //define which pins used for i2c
Serial.begin(9600);
// INA219 Current Sensor with OLED Display for Arduino Uno
//
// This sketch was modified from the Adafruit INA219 library example
//
// Gadget Reboot
//
// Required Libraries
// https://github.com/adafruit/Adafruit_INA219
// https://github.com/adafruit/Adafruit_SSD1306
/*
Simple script to send data to RequesBin
http://maxistar.ru/blog/%D0%9F%D0%BE%D1%81%D1%8B%D0%BB%D0%B0%D0%B5%D0%BC-%D0%B4%D0%B0%D0%BD%D0%BD%D1%8B%D0%B5-%D0%B2-%D0%BE%D0%B1%D0%BB%D0%B0%D0%BA%D0%BE/
The original script was found at https://RandomNerdTutorials.com/esp32-sim800l-publish-data-to-cloud/
Modified by Max Starikov
*/
// Your GPRS credentials (leave empty, if not needed)