This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default class BinaryStream { | |
_offset = 0; | |
_dataview = null; | |
_uint8Array = null; | |
constructor(buffer) { | |
this._dataview = new DataView(buffer); | |
this._uint8Array = new Uint8Array(buffer); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <fstream> | |
using Type = uint64_t; | |
bool isPalindrom(Type x) | |
{ | |
Type tmp {x}, y {0}; | |
while (tmp) { | |
y *= 10; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <iomanip> | |
#include <unordered_set> | |
#include <vector> | |
#include <fstream> | |
using Type = uint32_t; | |
using Magic = std::vector<Type>; | |
using Numbers = std::unordered_set<Type>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <iomanip> | |
#include <unordered_set> | |
#include <vector> | |
#include <fstream> | |
using Type = uint32_t; | |
using Magic = std::vector<Type>; | |
using Numbers = std::unordered_set<Type>; |