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.collection.mutable.ListBuffer | |
object Main { | |
val digits = 123456789 | |
val digitsSplit = digits.toString.map(_.asDigit) | |
val sum = 100 | |
def attachPrefix(prefix:ListBuffer[String], paths:ListBuffer[ListBuffer[String]]) = { | |
paths.filter(_.nonEmpty).map(p => prefix ++ p) | |
} |
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
object Main { | |
def sortOddEven(numbers:Array[Int]) = { | |
println(numbers.mkString(",")) | |
var left = 0 | |
var right = numbers.length - 1 | |
while (left < right) { | |
//Increment left index till we see an odd | |
while (numbers(left) % 2 == 0 && left < right) | |
left+=1 |
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 java.io.{IOException, StringReader, Reader, ByteArrayInputStream} | |
import java.nio.charset.Charset | |
import java.security.{NoSuchAlgorithmException, KeyFactory, PrivateKey} | |
import java.security.spec.{InvalidKeySpecException, PKCS8EncodedKeySpec} | |
import java.util.Collections | |
import com.google.api.client.json.webtoken.{JsonWebToken, JsonWebSignature} | |
import com.google.api.client.json.{JsonFactory, GenericJson, JsonObjectParser} | |
import com.google.api.client.json.jackson2.JacksonFactory | |
import com.google.api.client.util.{SecurityUtils, PemReader, Joiner} |
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 java.io.File | |
import java.util | |
import com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient | |
import com.amazonaws.services.dynamodbv2.document.spec._ | |
import com.amazonaws.services.dynamodbv2.document.utils.{NameMap, ValueMap} | |
import com.amazonaws.services.dynamodbv2.document._ | |
import com.amazonaws.services.dynamodbv2.model._ | |
import com.fasterxml.jackson.core.JsonFactory |