View 400.java
public class Solution {
public int findNthDigit(int n) {
int digitCount = 1;
long threshold = 9 * (long)Math.pow(10, digitCount - 1) * digitCount;
while (n > threshold) {
n -= threshold;
threshold /= digitCount;
threshold *= 10 * (++digitCount);
}
View Note.md

Notes

  • HTML5 history API
View test.py
# Definition for singly-linked list.
# class ListNode(object):
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution(object):
def reverseList(self, head):
prev = None
View snapchat.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/fetch/1.0.0/fetch.js">
</script>
<style>
View 84.js
/**
* @param {number[]} heights
* @return {number}
*/
function largestRectangleArea(heights) {
heights.push(-1);
var stack = [];
var max = 0;
heights.forEach((h, i) => {
View ha.cfg
global
maxconn 100
defaults
log global
option httplog
timeout connect 5000
timeout client 50000
timeout server 50000
View word-search.js
/*
HOW TO RUN THIS SCRIPT
node ws.js input.txt
*/
console.log(findPaths());
/*
main routine
*/
View merge-sort.js
function mergeSort(arr) {
if (arr.length < 2) return arr;
var mid = (arr.length - 1) >> 1;
var l = mergeSort(arr.slice(0, mid + 1));
var r = mergeSort(arr.slice(mid + 1));
return merge(l, r);
}