mirror of
https://github.com/jlengrand/hackerrank.git
synced 2026-03-10 08:21:24 +00:00
A repository to host my hackerrank submissions
This commit is contained in:
72
.gitignore
vendored
72
.gitignore
vendored
@@ -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
|
||||
|
||||
5
src/main/scala/Hello.scala
Normal file
5
src/main/scala/Hello.scala
Normal file
@@ -0,0 +1,5 @@
|
||||
object HelloWorld {
|
||||
def main(args: Array[String]): Unit = {
|
||||
println("Hello, world!")
|
||||
}
|
||||
}
|
||||
17
src/main/scala/algorithms/CompareTheTriplets/Solutionn.scala
Normal file
17
src/main/scala/algorithms/CompareTheTriplets/Solutionn.scala
Normal 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();
|
||||
}
|
||||
}
|
||||
19
src/main/scala/algorithms/SimpleArraySum/Solution.scala
Normal file
19
src/main/scala/algorithms/SimpleArraySum/Solution.scala
Normal 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)
|
||||
}
|
||||
}
|
||||
11
src/main/scala/algorithms/SolveMeFirst/Solution.scala
Normal file
11
src/main/scala/algorithms/SolveMeFirst/Solution.scala
Normal 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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user