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
| const port = 3000 | |
| var cors = require('cors'); | |
| const serveStatic = require('serve-static'); | |
| const express = require('express') | |
| const app = express() | |
| // var corsOptions = { | |
| // origin: "http://localhost", |
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
| use std::{path::Path, fmt::DebugSet}; | |
| fn main() { | |
| let mut parser = protobuf_parse::Parser::new(); | |
| parser.pure(); | |
| let file = Path::new("D:/protos/hello.proto"); | |
| parser.include("D:/protos"); | |
| parser.input(file); |
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
| static int[] GetRanks_Sort(int[] input) | |
| { | |
| int[] sorted = new int[input.Length]; | |
| Array.Copy(input, sorted, input.Length); | |
| Array.Sort(sorted); | |
| var ranked = new Dictionary<int, int>(); | |
| int rank = 1; | |
| int number = sorted[0]; | |
| ranked.Add(sorted[0], rank); |
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
| class PriorityQueue | |
| { | |
| private Dictionary<int, int> _frequencies; | |
| public PriorityQueue() | |
| { | |
| _frequencies = new Dictionary<int, int>(); | |
| } | |
| public void Add(int item) |
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 Solution | |
| { | |
| public IList<string> LetterCombinations(string digits) | |
| { | |
| var result = new List<string>(); | |
| if (string.IsNullOrEmpty(digits)) | |
| { | |
| return result; | |
| } |
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
| /* | |
| Determine whether there exists a one-to-one character mapping from one string s1 to another s2. | |
| For example, given s1 = abc and s2 = bcd, return true since we can map a to b, b to c, and c to d. | |
| Given s1 = foo and s2 = bar, return false since the o cannot map to two characters. | |
| */ |
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
| use std::fmt; | |
| use std::num; | |
| const SQUARE:i32 = 0; | |
| const PAWN:i32 = 1; | |
| const KNIGHT:i32 = 2; | |
| const BISHOP:i32 = 3; | |
| const ROOK:i32 = 4; |