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
| package main | |
| import ( | |
| "bufio" | |
| "fmt" | |
| "os" | |
| "strconv" | |
| ) | |
| func sqrt(n, precision float64) float64 { |
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
| #include <iostream> | |
| #include <memory> | |
| using namespace std; | |
| class Resource { | |
| public: | |
| Resource(string id) : _id(id) { | |
| cout << "Resource::Resource(" << _id << ")" << endl; |
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
| package main | |
| import "fmt" | |
| import "sync" | |
| import "sync/atomic" | |
| type semaphore struct { | |
| c *sync.Cond | |
| count int32 | |
| } |
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
| using System; | |
| using System.Linq; | |
| using System.IO; | |
| using System.Text; | |
| using System.Collections; | |
| using System.Collections.Generic; | |
| /** | |
| * Save humans, destroy zombies! | |
| **/ |
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
| package main | |
| import "fmt" | |
| import "math" | |
| import "sort" | |
| /** | |
| * Save humans, destroy zombies! | |
| **/ |
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
| package main | |
| import "fmt" | |
| import "os" | |
| type battleResult int | |
| const ( | |
| battle_p1_wins battleResult = iota | |
| battle_p2_wins |
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
| package main | |
| import "fmt" | |
| import "os" | |
| import "bufio" | |
| //import "strings" | |
| //import "strconv" | |
| /** |
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
| package main | |
| import "fmt" | |
| import "os" | |
| import "math" | |
| /** | |
| * Auto-generated code below aims at helping you parse | |
| * the standard input according to the problem statement. | |
| **/ |
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
| // Originally from: https://www.quora.com/What-is-the-toughest-coding-question-that-you-faced-in-an-interview | |
| // | |
| // You have 4 strings. | |
| // You can rearrange each string in anyway you want and then you are going to construct a trie from these 4 strings. | |
| // What is the minimum possible number of nodes in this trie? | |
| namespace Test | |
| { | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; |
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
| public class StoryFactory | |
| { | |
| public void StartNew(string name, Action action) | |
| { | |
| } | |
| public T StartNew(string name, Func<T> func) | |
| { | |
| } |
NewerOlder