Instantly share code, notes, and snippets.

View FindWordsInDictionary.cs
/*
Given a 2D board and a list of words from the dictionary, find all words in the board.
Each word must be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or vertically neighboring. The same letter cell may not be used more than once in a word.
Input:
words = ["oath","pea","eat","rain"] and board =
[
['o','a','a','n'],
View minimum number of conference room - mock interview
Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],...] (si < ei), find the minimum number of conference rooms required.
Input: [[0, 30],[5, 10],[15, 20]]
Output: 2
line sweep algorithm
0 --------------------------30
5----10 15------20
--------------------------------->
View group anagrams - mock interview as an interviewee
Given an array of strings, group anagrams together.
Input: ["eat", "tea", "tan", "ate", "nat", "bat"],
Output:
[
["ate","eat","tea"],
["nat","tan"],
["bat"]
]
View leetcode practice group wechat
湾区周末刷题Hackthon
1.一天五个小时刷20道左右(中间有午休),题目从lintcode或leetcode随机选取medium或以上.
2.Hackthon带有竞赛的性质,每天总排名第一和最后一名的要发红包意思一下.
3.竞赛按照每题的AC速度排名进行积分。
4.每题80%的人做完的话就停止。难题超过20分钟也停止,可以请先做出来的大牛简单讲解。
5.地点在南湾sunnyvale
6.参赛的人水平不限,但建议参加过Leetcode周赛10次以上,并且至少一次进入过前200名。(本次参加过70次,27次前200名,7次前50)。
报名时请出示leetcode ID
7.Hackthon报名四人以上成行。
View Talk about Leetcode, contest
http://www.1point3acres.com/bbs/thread-443485-1-1.html
[经验总结] ECE硕士从找工作碰壁到拿到Google offer
(2)我自学了什么?
在刚毕业的时候,我对CS了解有限,尝试面试了很多公司的software职位,屡屡碰壁。在地里大佬经验帖以及逐渐积累的面试经历帮助下,
我找到了我需要加强/自学的东西,我个人总结成5个方面。
一个重要的前提是精通一个编程语言,我从嵌入式C转为C++ 选择编程语言的过程中在C++与Java之间有过纠结,但当时的我认为C++与C更像,
更容易上手
View 415AddString.cs
public class Solution {
public string AddStrings(String num1, String num2)
{
if (num1 == null || num1.Length == 0)
return num2;
if (num2 == null || num2.Length == 0)
return num1;
var length1 = num1.Length;
var length2 = num2.Length;
View SlidingWindowMinimum.java
/*second algorithm:
given an integer array, for example, [3, 5, 4, 6, 5, 9, 7], given an integer k = 3
minArray[0] = min{3, 5, 4}
minArray[1] = min{5, 4, 6}
minArray[2] = min{4, 6, 5},
...*/
/*
arr = [3, 5, 4, 6, 5, 9, 7]
k = 3
View 902NumbersAtMostNGivenDigitSet.cs
public class Solution {
public int AtMostNGivenDigitSet(string[] sortedDigits, int N)
{
var number = AtMostNGivenDigitSetHelper(sortedDigits, N);
return number;
}
public static int AtMostNGivenDigitSetHelper(string[] sortedDigits, int N)
{
View 400NthDigit_failedSubmission.cs
public class Solution {
public int FindNthDigit(int n) // 8, return 8
{
var preprocessed = getPreprocessNumbers();
var length = preprocessed.Count;
/// there are 28 entries in the list
for (int i = 0; i < length; i++)
{
View Leetcode400_NthDigit_FirstSubmission.cs
public class Solution {
public int FindNthDigit(int n) // 8, return 8
{
var preprocessed = getPreprocessNumbers();
var length = preprocessed.Count;
/// there are 28 entries in the list
for (int i = 0; i < length; i++ )
{