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
var router = Router.create({ | |
routes, | |
location, | |
onAbort: function defaultAbortHandler(abortReason) { | |
reject(abortReason); | |
} | |
}); | |
router.run(function (Handler, State) { |
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
import scala.io.StdIn.{readInt,readLine} | |
import scala.io.Source | |
object Solution { | |
def main(args: Array[String]) { | |
val count = readInt() | |
val phoneBook = (1 to count).foldLeft(List[String]())((phoneBook, _) => { | |
readLine().split(" ") match { | |
case Array(k, v) if v.endsWith("@gmail.com") => phoneBook :+ k | |
case _ => phoneBook |
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
-module(solution). | |
-export([main/0]). | |
main() -> | |
printContacts(sortContacts(filterContacts(createContacts(readAll())))). | |
readAll() -> | |
readAll([], io:get_chars("", 4096)). | |
readAll(In, eof) -> | |
[StringN|Lines] = string:tokens(lists:flatten(lists:reverse(In)), "\n"), |
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
use std::io; | |
use std::io::BufRead; | |
fn main() { | |
let stdin = io::stdin(); | |
let lines: Vec<std::string::String> = stdin.lock().lines().map(|l| l.unwrap()).collect(); | |
let trimmed = lines[0].trim(); | |
let mut count = 0; | |
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
import scala.io.StdIn.{readLine} | |
import scala.io.Source | |
import java.util.{GregorianCalendar, Calendar} | |
object Solution { | |
def main(args: Array[String]) { | |
val actualCalendar = createCalendar(readLine()) | |
val expectedCalendar = createCalendar(readLine()) | |
val (diffYear, diffMonth, diffDay) = calculateDateDiff(actualCalendar, expectedCalendar) |
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
% Enter your code here. Read input from STDIN. Print output to STDOUT | |
% Your class should be named solution | |
-module(solution). | |
-export([main/0]). | |
main() -> | |
DateReturned = readDate(), | |
DueDate = readDate(), | |
DateDiff = calculateDifference(DateReturned, DueDate), |
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
use std::io; | |
use std::io::BufRead; | |
fn main() { | |
let stdin = io::stdin(); | |
let lines: Vec<std::string::String> = stdin.lock().lines().map(|l| l.unwrap()).collect(); | |
let date_returned_vec: Vec<&str> = lines[0].split_whitespace().collect(); | |
let due_date_vec: Vec<&str> = lines[1].split_whitespace().collect(); | |
let date_returned = construct_date(date_returned_vec[0], date_returned_vec[1], date_returned_vec[2]); |
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
import scala.io.StdIn.{readInt,readLine} | |
import scala.io.Source | |
object Solution { | |
def main(args: Array[String]) { | |
val count = readInt() | |
val phoneBook = (1 to count).foldLeft(Map[String, String]())((phoneBook, _) => { | |
readLine().split(" ") match { | |
case Array(k, v) => phoneBook + (k -> v) |
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
% Enter your code here. Read input from STDIN. Print output to STDOUT | |
% Your class should be named solution | |
-module(solution). | |
-export([main/0]). | |
main() -> | |
runQueries(createPhoneBook(readAll())). | |
readAll() -> |
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
use std::io; | |
use std::io::BufRead; | |
use std::collections::HashMap; | |
fn main() { | |
let stdin = io::stdin(); | |
let lines: Vec<std::string::String> = stdin.lock().lines().map(|l| l.unwrap()).collect(); | |
let trimmed = lines[0].trim(); | |
let mut count = 0; |
NewerOlder