A repository to host my hackerrank submissions

This commit is contained in:
jll
2017-03-04 12:02:56 +01:00
parent 947df7e802
commit 1a1abb80cf
5 changed files with 119 additions and 5 deletions

72
.gitignore vendored
View File

@@ -1,12 +1,74 @@
# Simple Build Tool
# http://www.scala-sbt.org/release/docs/Getting-Started/Directories.html#configuring-version-control
# Created by http://www.gitignore.io
### Scala ###
*.class
*.log
# sbt specific
.cache/
.history/
.lib/
dist/*
target/
lib_managed/
src_managed/
project/boot/
project/plugins/project/
.history
.cache
.lib/
# Scala-IDE specific
.scala_dependencies
.worksheet
### Intellij ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff:
.idea/**/workspace.xml
.idea/**/tasks.xml
# Sensitive or high-churn files:
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.xml
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
# Gradle:
.idea/**/gradle.xml
.idea/**/libraries
# Mongo Explorer plugin:
.idea/**/mongoSettings.xml
## File-based project format:
*.iws
## Plugin-specific files:
# IntelliJ
/out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
### Intellij Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
# *.iml
# modules.xml
# .idea/misc.xml
# *.ipr
# End of https://www.gitignore.io/api/intellij

View File

@@ -0,0 +1,5 @@
object HelloWorld {
def main(args: Array[String]): Unit = {
println("Hello, world!")
}
}

View File

@@ -0,0 +1,17 @@
package algorithms.CompareTheTriplets
/**
* Created by jll on 3/3/2017.
*/
object Solution {
def main(args: Array[String]) {
val sc = new java.util.Scanner (System.in);
var a0 = sc.nextInt();
var a1 = sc.nextInt();
var a2 = sc.nextInt();
var b0 = sc.nextInt();
var b1 = sc.nextInt();
var b2 = sc.nextInt();
}
}

View File

@@ -0,0 +1,19 @@
package algorithms.SimpleArraySum
/**
* Created by jll on 3/3/2017.
*/
object Solution {
def main(args: Array[String]) {
val sc = new java.util.Scanner (System.in);
var n = sc.nextInt();
var arr = new Array[Int](n);
for(arr_i <- 0 to n-1) {
arr(arr_i) = sc.nextInt();
}
println(arr.map(_.toInt).sum)
}
}

View File

@@ -0,0 +1,11 @@
package algorithms.SolveMeFirst
/**
* Created by jll on 3/3/2017.
*/
object Solution {
def main(args: Array[String]) {
println(io.Source.stdin.getLines().take(2).map(_.toInt).sum)
}
}