This file contains hidden or 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
| std::string add(std::string augend, std::string addend) | |
| { | |
| // Reverse two numbers, make them 0-index aligned | |
| std::reverse(augend.begin(), augend.end()); | |
| std::reverse(addend.begin(), addend.end()); | |
| std::string result; | |
| auto max_length = std::max(augend.size(), addend.size()); | |
| // To mark if there's a carry |
This file contains hidden or 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
| import java.util.Random; | |
| public class Main { | |
| public static void main(String[] args) { | |
| for(var a = 0; a < 100; a++) { | |
| int count = 0; | |
| for (var i = 0; i < 20000; i++) { | |
| var x = new Random().doubles(0, 2).findFirst().getAsDouble(); | |
| var y = new Random().doubles(0, 2).findFirst().getAsDouble(); |