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 Solution { | |
fun solution(a: Int, b: Int): String { | |
val month = listOf(31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31) | |
val dayOfWeek = listOf("FRI", "SAT", "SUN", "MON", "TUE", "WED", "THU") | |
var diff = 0 | |
for (i in 0 until a - 1) { | |
diff += month[i] | |
} |
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 kotlin.math.abs | |
class Solution { | |
fun solution(n: Int, lost: IntArray, reserve: IntArray): Int { | |
var lost2 = lost.toMutableList() | |
var reserve2 = reserve.toMutableList() | |
var dup = mutableListOf<Int>() | |
for (l in lost2){ | |
for (r in reserve2){ |
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 Solution { | |
fun solution(array: IntArray, commands: Array<IntArray>): IntArray { | |
var answer = mutableListOf<Int>() | |
for (command in commands) { | |
var subList = array.toList() | |
.subList(command[0] - 1, command[1]) | |
subList = subList.sorted() |
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 Solution { | |
fun solution(answers: IntArray): IntArray { | |
val size = answers.size | |
val oneReport = oneReport(size) | |
val twoReport = twoReport(size) | |
val threeReport = threeReport(size) | |
val scoreOfOne = scoreCorrect(oneReport, answers) | |
val scoreOfTwo = scoreCorrect(twoReport, answers) |
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
@Data | |
@Builder | |
public class ShopResponse { | |
private long id; | |
private String name; | |
} | |
----------------------------------------------------- | |
public class ShopResponseBuilder { |
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
if (a > 0) { | |
if (b == 0){ | |
doA(); | |
} | |
} else { | |
doB(); | |
} |
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
if (a <= 0){ | |
doB(); | |
return; | |
} | |
if (b == 0) { | |
doA(); | |
} |
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
function doABC() { | |
doA() | |
if (a > b && c > 0 || d == 0) { | |
doBasicB() | |
if (e < -1){ | |
doAnotherB() | |
} | |
} |
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
function doABC() { | |
doA() | |
doB() | |
doC() | |
} | |
function doA() { | |
doBasicA() | |
doAnotherA() | |
} |
NewerOlder