Skip to content

Instantly share code, notes, and snippets.

function doABC() {
doA()
doB()
doC()
}
function doA() {
doBasicA()
doAnotherA()
}
function doABC() {
doA()
if (a > b && c > 0 || d == 0) {
doBasicB()
if (e < -1){
doAnotherB()
}
}
if (a <= 0){
doB();
return;
}
if (b == 0) {
doA();
}
if (a > 0) {
if (b == 0){
doA();
}
} else {
doB();
}
@Data
@Builder
public class ShopResponse {
private long id;
private String name;
}
-----------------------------------------------------
public class ShopResponseBuilder {
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)
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()
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){
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]
}
class Solution {
fun solution(record: Array<String>): Array<String> {
var answer = mutableListOf<String>()
var nickNameMap = mutableMapOf<String, String>()
var history = mutableListOf<Pair<String, String>>()
for (line in record) {
val tokens = line.split(" ")