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
package com.revature.eval.java.core; | |
import java.util.*; | |
import java.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
public class EvaluationService { | |
/** | |
* 1.A Speed Converter - Convert to MilesPerHour |
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
class KthSmallest { | |
var arr = intArrayOf(45,34,5,6,34,7,78,9,79,0,89,70,58,54,68,73,72,82,45,67,32,67,92) | |
var k = 7 | |
} | |
fun main(){ | |
val a: KthSmallest = KthSmallest() | |
println(a.arr.size) | |
var sortedA = a.arr.sortedBy { it.dec() } |
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
//2. Given an array arr[] of positive integers of size N. Reverse every sub-array group of | |
//size K. | |
fun main(){ | |
var c : MyArrays = MyArrays() | |
//println( c.arr.toSortedSet()) | |
var mySorted = c.arr.sortedBy { it.dec() } | |
println(mySorted) |
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
fun main() { | |
//var e:Exercise1 = Exercise1() | |
var sen = mutableListOf("lof",123,45, "komb",67,78,"honda",456,"lophomgmjtldgk7","joingsds", "persontwo","hello","hendustan","koghtndbsa","gregerggdfgd","gregerggdfgr","lophomgmjtldgkt","lophomgmjrldgko") | |
val myList = mutableListOf<Any>() | |
for (i in sen){ | |
myList.add(i.toString()) | |
} | |
//println(myList) |
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
//contains the results we get from the response | |
data class UnsplashResponse ( | |
val results: List<UnsplashPhoto> | |
) |
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
<?xml version="1.0" encoding="utf-8"?> | |
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:context=".MainActivity"> | |
<androidx.fragment.app.FragmentContainerView | |
android:id="@+id/nav_host_fragment_main" |
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
plugins { | |
id 'com.android.application' | |
id 'org.jetbrains.kotlin.android' | |
id 'kotlin-parcelize' | |
} | |
android { | |
compileSdk 32 | |
defaultConfig { |
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 android.os.Parcelable | |
import kotlinx.parcelize.Parcelize | |
@Parcelize | |
data class UnsplashPhoto( | |
val id: String, | |
val description: String, | |
val urls: UnsplashPhotoUrls,//urls have their own properties | |
val user: UnsplashUser, //users have their own properties |