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::io::prelude::*; | |
| use std::str::FromStr; | |
| fn main() { | |
| // solve_a(); | |
| solve_b(); | |
| } | |
| fn solve_a() { | |
| let lines = std::io::stdin().lock().lines().map(|x| x.unwrap()).collect::<Vec<String>>(); |
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
| void main() { | |
| final s = "L'été"; | |
| final c = s[s.length - 1]; | |
| print("The last character of \"$s\" is '$c'"); | |
| } |
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
| void main() { | |
| final s = "Cat"; | |
| final c = s[s.length - 1]; | |
| print("The last character of \"$s\" is '$c'"); | |
| } |
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
| void main() { | |
| print('Test permalink'); | |
| } |
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 Person { | |
| String id; | |
| String firstName, lastName; | |
| Person(this.id, this.firstName, this.lastName); | |
| @override | |
| String toString() { | |
| return "$firstName $lastName"; | |
| } | |
| } |
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 'dart:convert'; | |
| void main() { | |
| const x = {'text': 'foo', 'value': '2'}; | |
| var encoded = const JsonEncoder.withIndent(' ').convert(x); | |
| print(encoded); | |
| } |
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 bench | |
| import "testing" | |
| var fooMap = map[string]int{"a": 1, "b": 2} | |
| func Foo1(s string) int { | |
| return fooMap[s] | |
| } |
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
| void main() { | |
| var m = { | |
| "one": 1, | |
| "two": 2 | |
| }; | |
| final k = m.keys; | |
| print(k); | |
| } |
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
| def items = ["bleen", "fuligin", "garrow", "grue", "hooloovoo"] | |
| def x = items.last() | |
| println x |
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
| def x = ["bleen", "fuligin", "garrow", "grue", "hooloovoo"] | |
| def a = x.shuffled().first() | |
| println a |
NewerOlder