Skip to content

Instantly share code, notes, and snippets.

View ccampores-n26's full-sized avatar
🌊

Chiara Camporesi ccampores-n26

🌊
View GitHub Profile
@ccampores-n26
ccampores-n26 / dsa.kt
Created December 28, 2024 16:00
DSA Cheat Sheet
// Two pointers: one input, opposite ends
fun twoPointers(arr: IntArray): Int {
var left = 0
var right = arr.size - 1
val ans = 0
while (left < right) {
// do some logic here with left and right
if (CONDITION) {
left++
@ccampores-n26
ccampores-n26 / FileHostingService.kt
Last active December 28, 2024 15:54
Demo FileHostingService
import java.time.Instant
data class File(
val filename: String,
val size: Int,
val createdAt: Long? = null,
val ttlSec: Long? = null
) {
fun isAlive(timestamp: Long): Boolean {
if (ttlSec == null || createdAt == null)
@ccampores-n26
ccampores-n26 / .gitconfig
Created December 28, 2024 15:38
.gitconfig
[alias]
s = status
a = add
co = checkout
cm = commit -m
amend = commit --amend -m