Skip to content

Instantly share code, notes, and snippets.

View maymax777's full-sized avatar
😇
What's happening?

maymax maymax777

😇
What's happening?
View GitHub Profile
pragma solidity ^0.4.19;
contract MaximumMultiple {
function maxMultiple(int d, int b) public pure returns (int) {
//
int max = d > b ? d : b;
int min = d < b ? d : b;
return max - max % min;
}
}
pragma solidity ^0.4.19;
contract Century {
function get(int year) public pure returns (int) {
return (year - 1) / 100 + 1;
}
}
pragma solidity ^0.4.19;
contract Problem {
function rowSumOddNumbers(int n) public pure returns (int) {
int end = (1 + n ) * n - 1;
int start = end - 2 * (n - 1);
int sum = (start + end) * n / 2;
return sum;
}
}
pragma solidity ^0.4.13;
contract Repeater {
function multiply(uint8 repeat, string pattern) returns (string) {
bytes memory bpattern = bytes(pattern);
uint resultLength = repeat * bpattern.length;
string memory result = new string(resultLength);
bytes memory bresult = bytes(result);
for (uint i = 0; i < resultLength; i++) {
bresult[i] = bpattern[i % bpattern.length];
pragma solidity ^0.4.19;
contract Roman {
uint[] key = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1];
string[] numerals = ["M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I"];
function solution(uint n) public view returns (string) {
// Convert the positive integer to a Roman Numeral
string memory res = "";
@maymax777
maymax777 / index.html
Last active May 10, 2021 02:56
Access to camera and audio
<!-- HTML -->
<video id="video" width="160" height="120" autoplay></video><br>
<div id="div"></div>