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
| [{ | |
| "name": "felipe", | |
| "age": 33 | |
| }, { | |
| "name": "ty", | |
| "age": 3 | |
| }] |
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 azkaban.security; | |
| import java.util.ArrayList; | |
| import java.util.HashMap; | |
| import java.util.List; | |
| import java.util.Map; | |
| import org.apache.commons.lang.exception.ExceptionUtils; | |
| import org.joda.time.DateTime; | |
| import org.joda.time.DateTimeZone; |
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
| spring_profiles: postgresql | |
| database: | |
| driverClassName: org.postgresql.Driver | |
| url: jdbc:postgresql://uaa.ccbvglwadavl.us-west-2.rds.amazonaws.com:5432:/uaa | |
| username: uaa | |
| password: uaauaauaa | |
| jwt: | |
| token: |
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
| spring_profiles: postgresql | |
| database: | |
| driverClassName: org.postgresql.Driver | |
| url: jdbc:postgresql://${DB_PORT_5432_TCP_ADDR}:${DB_PORT_5432_TCP_PORT}/${DB_ENV_DB:postgres} | |
| username: ${DB_ENV_USER:postgres} | |
| password: ${DB_ENV_PASS:} | |
| jwt: | |
| token: |
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
| #!/usr/bin/python | |
| import sys | |
| import getopt | |
| import fileinput | |
| import csv | |
| import json | |
| import bcrypt | |
| def main(argv): |
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
| object Solution { | |
| def solution(S: String): Int = { | |
| val max = S.length / 2 | |
| @scala.annotation.tailrec | |
| def symmetryPoint(i: Int): Int = { | |
| val left = S(i) | |
| val right = S(S.length - 1 - i) |
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
| object Solution { | |
| def solution(T: Tree): Int = { | |
| def height(t: Tree, i: Int): Int = { | |
| val left = (Option(t.l).map(height(_, i + 1)) getOrElse i) | |
| val right = (Option(t.r).map(height(_, i + 1)) getOrElse i) | |
| scala.math.max(i, scala.math.max(left, right)) | |
| } |
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
| object Solution { | |
| def solution(A: Array[Int]): Int = { | |
| val N = A.size | |
| if (N < 1 || N > 1000000) sys.error(s"Invalid array size: $N") | |
| A.foldLeft(0) { (current, i) => | |
| i ^ current | |
| } | |
| } |
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
| object Solution { | |
| def solution(N: Int): Int = { | |
| if (N < 1) sys.error(s"Invalid input: $N") | |
| @scala.annotation.tailrec | |
| def foo(i: Int, total: Int): (Int, Int) = { | |
| if ((i * i) >= N) (total, i) | |
| else if (N % i == 0) foo(i + 1, total + 2) | |
| else foo(i + 1, total) | |
| } |
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
| object Solution { | |
| def solution(A: Array[Int]): Int = { | |
| val bitz = new java.util.BitSet(A.size) | |
| val n = A.foldLeft(0) { (total, i) => | |
| if (i > 0 && i <= A.size && !bitz.get(i)) { | |
| bitz.set(i) | |
| total + 1 | |
| } else total |