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
[user] | |
name = Joel Tong | |
email = [email protected] | |
[core] | |
editor = nvim | |
ignorecase = false | |
[init] | |
defaultBranch = main | |
[push] | |
default = current |
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
<div class="flex h-screen"> | |
<div class="m-auto"> | |
<h3>title</h3> | |
<button>button</button> | |
</div> | |
</div> |
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 java.util.ArrayList; | |
import java.util.List; | |
public class FlattenBstToLinkedList { | |
static class Node { | |
Node left; | |
Node right; | |
int val; | |
} |
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 java.util.ArrayList; | |
import java.util.List; | |
public class ValidBST { | |
public static class Node { | |
Node left; | |
Node right; | |
int x; | |
} |
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 java.util.Arrays; | |
public class NQueens { | |
private static boolean nQueens(int[][] board, int col) { | |
if (col >= board.length) { | |
return true; | |
} |
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 java.util.HashSet; | |
import java.util.Set; | |
public class LongestNonrepeatingSubstring { | |
public static void main(String[] args) { | |
String input = "pwwkew"; | |
System.out.println(longestNonrepeatingSubstr(input)); | |
} |
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 java.util.HashSet; | |
import java.util.Set; | |
public class Djistrika { | |
public static final int V = 9; | |
public static void dijkstra(int[][] graph, int ref) { | |
// Initialize vars |
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
const compose = (...fns) => fns.reduceRight( | |
(prevFn, nextFn) => (...args) => nextFn(prevFn(...args)), | |
value => value | |
); | |
const EatMixin = Superclass => class extends Superclass { | |
eat(food) { | |
console.log(`eating ${food}`); | |
} |
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 org.joeltong.test; | |
import java.util.Arrays; | |
public class QuickSort { | |
private static void quickSort(int[] arr) { | |
quickSort(arr, 0, arr.length-1); | |
} |
NewerOlder