- 博客(16)
- 收藏
- 关注
原创 LeetCode 89: Gray Code Generator
See explain of Gray Code: https://en.wikipedia.org/wiki/Gray_code1-bit Grey Code: 0, 12-bits Grey Code: 00, 01, 11, 103-bits Grey Code: 000, 001, 011, 010, 110, 111, 101, 1004-bits Grey Code:
2016-03-29 07:41:56 223
原创 LeetCode 318. Maximum Product of Word Lengths
The tough part here is on how to detect whether two words sharing common letters.As indicate in the question, each word only contains lower case letters 'a' - 'z', we can actually correlate this pr
2016-03-29 07:01:36 161
原创 LeetCode 268: Missing Number
Missing number. Given an array containing n distinct numbers taken from 0, 1, 2, ... n, find the one that is missing from the array.for example: Given nums = [0, 1, 3] return 2;// This one is
2016-03-29 04:44:17 167
原创 LeetCode 260. Single Number III
Given an array of Numbers nums, in which exactly two elements appear only once and all other elements appear exactly twice. Find the two elements that appear only once.For example:Given nums = [1
2016-03-29 04:01:52 174
原创 LeetCode 136. Single Number
Given an array of integers, every elements appears twice expect for one. Find the single one. Do it without using extra memory.This problem can be solved using "set" or Hash Map. However, it is goin
2016-03-29 03:49:33 210
原创 CRCK 1.6 (Easy can be extened to Hard)
Given an image represented by an NxN matrix, where each pixel in the image is 4 bytes, write a method to rotate the image by 90 degrees. Can you do this in palace?(This problem is in Easy Level)Ex
2016-03-29 01:30:14 310
原创 Top 11 websites for practise programming
1: TopCoder. The world largest programming compete website. It hosts SRM for contest.2: CodeChef. It is hosted by an Indian Company, claimed to be non-profit.3: SPOJ. It is an online Judge system
2016-03-29 01:15:00 262
原创 CRCK array 1.8
Assume you have a method isSubstring which checks if one word is a substring of another. Given two strings, s1 and s2, write code to check if s2 is a rotation of s1 using only one call to isSubstring
2016-03-27 06:07:52 200
原创 CRCK array 1.5 (easy)
Write a method to replace all spaces in a string with ‘%20’.// there are actually no tricks in this problem.// the API can be a vector, however, the idea is the same.string repaceSpaces(string input
2016-03-27 01:20:47 191
原创 CRCK array 1.4
Write a method to decide if two strings are anagrams or not.There are two ways to solve this problem.// use the sort algorithm in C++.// Time complexity (nLgn), space o(1);bool isAnagrams(string a
2016-03-27 00:55:16 181
原创 CRCK, array 1.2
Write code to reverse a C-Style String. (C-String means that “abcd” is represented as five characters, including the null character.)// This question is for C/C++ programmer.// #include if programm
2016-03-27 00:41:35 224
原创 CRCK: Array 1.1 (easy)
Cracking the Code interview 1.1: Implement an algorithm to determine if a string has all unique characters and what if you can't use additional data structures. (easy level)// First with extra dat
2016-03-27 00:03:33 243
原创 Facebook Phone Interview: 3, 4 Sum (Easy)
Facebook really usually has a high frequency of posting repetitive problems.This one is the typical 3Sum, 4Sum problem.Given an input array and a target value, find whether there are three/four
2016-03-23 09:57:28 341
原创 Facebook Phone Interview: Phone Number to Letter Combinations
Input: string of digits of arbitrary lengthoutput: print all possible letter combinations for those digits to screen.// This is a typical DFS algorithm.// Suppose we dont know the phone screen l
2016-03-23 07:41:29 365
原创 Facebook Phone Interview -- Move Zeros to Right (Easy)
March 22th, 2016.Move Zeros to the right end but keep the order of non-zero numbers.#include #inlcude #include using namespace std;// move Zeros to the right end of the array.// classi
2016-03-23 07:13:27 281
原创 Start as a fresh.....
I interned in Google Inc. twice. First internship was in Privacy & Infrastructure team, mentored by Christopher (Belgian Cryptographer ) and Daniel (Swiss Cryptographer). My project mainly focused
2016-03-18 03:38:59 362
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人