Skip to content

Instantly share code, notes, and snippets.

@asclines
asclines / NewYearChaosSolution.cpp
Created Feb 14, 2017
My solution to HackerRanks New Year Chaos problem
View NewYearChaosSolution.cpp
#include <iostream>
#include <string>
int main() {
int T; // Number of test cases 1 <= T <= 10
int N; // Number of people in line 1 <= N <= 10^5
std::cin >> T;
for (int t = 0; t < T; t++) { // For each test case
@asclines
asclines / trumpCountdownSlash.js
Last active Mar 15, 2017
Slack slash command returning how long till Trump is out of office
View trumpCountdownSlash.js
Date.daysBetween = function (date1, date2) {
//Get 1 day in milliseconds
var one_day = 1000 * 60 * 60 * 24;
// Convert both dates to milliseconds
var date1_ms = date1.getTime();
var date2_ms = date2.getTime();
// Calculate the difference in milliseconds
var difference_ms = date2_ms - date1_ms;
View maxmin.java
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
public class Solution {
public static void main(String[] args) throws NumberFormatException, IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
View staircase.java
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class Solution {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
View staircase.java
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class Solution {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
View classsObjects.cpp
class Student{
private:
int scores[5];
public:
void input(){
for(int i = 0; i < 5; i ++){
cin >> scores[i];
}
}