原创 [US Giants] 八. Search & Recurison

Word Search Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from lette

原创 [Project] Online Notes App

1. 資源    boostrap模板:getboostrap    navbar generator:twitter bootstrap navbar generator    字體:google fonts 2. 關於文本樣式簡略顯示

原创 [Amazon] Continuous Subarray Sum

Given an integer array, find a continuous subarray where the sum of numbers is the biggest. Your code should return t

原创 [二戰]

686. Repeated String Match class Solution { public int repeatedStringMatch(String A, String B) { if(A == n

原创 [Microsoft] O(1) Check Power of 2

Using O(1) time to check whether an integer n is a power of 2. Example For n=4, return true; For n=5, return fa

原创 [US Giants] 一. String

Longest Common Subarray Given two strings, find the longest common substring. Return the length of it. The characte

原创 [US Giants] 四.Math & Bit Manipulation

Trailing Zeros Write an algorithm which computes the number of trailing zeros in n factorial. Example:11! = 399168

原创 [US Giants] 六. Linked List

Remove Nth Node From End of List Given a linked list, remove the nth node from the end of list and return its head.

原创 [US Giants] 五. Greedy

Single Number Given 2*n + 1 numbers, every numbers occurs twice except one, find it. Example: Given [1,2,2,1,3,4

原创 [Microsoft] Linked List Cycle

/** * Definition for ListNode. * public class ListNode { * int val; * ListNode next; * ListNode(int va

原创 [Microsoft] Find Peak Element

There is an integer array which has the following features: The numbers in adjacent positions are different.A[0] < A[

原创 [高頻] 六.數學,幾何計算,位運算常見問題

38. Search a 2D Matrix II: 點擊打開鏈接   [ [1, 3, 5, 7], [2, 4, 7, 8], [3, 5, 9, 10] ]   思路:從第一行最後一個元素(或者第一列最後一個元素)開始

原创 [US Giants] 二. Integer-Array

Remove Element Given an array and a value, remove all occurrences of that value in place and return the new length.

原创 [Algorithm] Rotate 問題

Rotate String Given a string and an offset, rotate string by offset. (rotate from left to right) Example Given "

原创 [Microsoft] Search a 2D Matrix

Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: