自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(129)
  • 资源 (1)
  • 收藏
  • 关注

转载 欢迎使用CSDN-markdown编辑器

欢迎使用Markdown编辑器写博客本Markdown编辑器使用StackEdit修改而来,用它写博客,将会带来全新的体验哦:Markdown和扩展Markdown简洁的语法代码块高亮图片链接和图片上传LaTex数学公式UML序列图和流程图离线写博客导入导出Markdown文件丰富的快捷键快捷键加粗 Ctrl + B 斜体 Ctrl + I 引用 Ctrl

2016-06-13 10:02:29 324

原创 Xcode 自定义Log

常用写法,功能简单:#ifdef DEBUG#define JFLog(...) NSLog(__VA_ARGS__)#else#define JFLog(...)#endif更复杂的写法,能打印更多调试信息:#ifdef DEBUG#define JFLog(...) NSLog(@"%s %d\n %@\n", __func__, __LIN

2015-09-14 17:29:17 575

原创 Request failed: unacceptable content-type: text/plain

今天利用AFNetworking框架发送一个POST请求,结果始终失败刚开始找错了方向,以为是参数拼接错误,仔细检查之后,原来是因为AFN的AFJSONResponseSerializer默认不支持text/plain类型解决办法:找到AFN框架下的 AFURLResponseSerialization.m 文件的第223行 添加一个参数即可。修改为:self.

2015-07-20 20:38:05 652

原创 ARC forbids explicit message send of 'autolease'

原因很明显,是导入了非ARC的第三方库。虽然可以在项目的build setting 里面将项目改为非ARC,暂时解决这个问题。但是蛋疼的是其他用到ARC的地方又有问题了。所以比较好的办法是告诉编译器,对这个第三方的库要用非ARC方式编译,其他的继续用ARC。解决办法:找到项目的Build Phase里面的Complie Sources,找到对应的编译不过的源文件。双击,在右边的

2015-07-14 15:36:04 334

原创 libxml/tree.h file not found

虽然导入了libxml2库,但是找不到,原因是路径错误。按下图样式增加一行路径配置即可$SDKROOT/usr/include/libxml2

2015-07-14 15:19:21 359

原创 [LeetCode] Longest Palindromic Substring

Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring.

2014-11-07 01:21:09 422

原创 单链表的逆置

这种基础题面试时经常碰到,昨天去面试的时候。又碰到了。

2014-11-03 11:43:52 423

原创 求二叉树中节点的最大距离

昨天面试问道这个问题,这个问题在编程之美上见过,但是不记得过程了。没答上来。jin

2014-11-03 11:35:51 495

原创 [LeetCode] Word Ladder

Given two words (start and end), and a dictionary, find the length of shortest transformation sequence from start to end, such that:Only one letter can be changed at a timeEach intermediate word m

2014-11-01 22:27:14 433

原创 [LeetCode] Wildcard Matching

Implement wildcard pattern matching with support for '?' and '*'.'?' Matches any single character.'*' Matches any sequence of characters (including the empty sequence).The matching should cover t

2014-11-01 19:57:35 471

原创 [LeetCode] Permutations II

Given a collection of numbers that might contain duplicates, return all possible unique permutations.For example,[1,1,2] have the following unique permutations:[1,1,2], [1,2,1], and [2,1,1].

2014-11-01 18:07:08 501

原创 [LeetCode] Permutations

Given a collection of numbers, return all possible permutations.For example,[1,2,3] have the following permutations:[1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], and [3,2,1].class Solution

2014-11-01 18:01:57 406

原创 [LeetCode] Validate Binary Search Tree

Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contains only nodes with keys less than the node's key.Th

2014-10-29 22:14:59 427

原创 [LeetCode] Recover Binary Search Tree

Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note:A solution using O(n) space is pretty straight forward. Could you devis

2014-10-29 22:07:12 418

原创 [LeetCode] Word Search

Given a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or vertically

2014-10-26 22:37:55 456

原创 [LeetCode] Jump Game

Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.Determine i

2014-10-23 19:09:14 411

原创 [LeetCode] Jump Game II

Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.Your goal i

2014-10-23 19:07:26 391

原创 [LeetCode] Combination Sum II

Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.Each number in C may only be used once in the combina

2014-10-23 16:38:47 491

原创 [LeetCode] Combination Sum

Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.The same repeated number may be chosen from C unlimited numb

2014-10-23 15:51:50 378

原创 [LeetCode] First Missing Positive

Given an unsorted integer array, find the first missing positive integer.For example,Given [1,2,0] return 3,and [3,4,-1,1] return 2.Your algorithm should run in O(n) time and uses constant

2014-10-23 15:30:42 312

原创 [LeetCode] Reverse Nodes in k-Group

Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.If the number of nodes is not a multiple of k then left-out nodes in the end should remain as it is

2014-10-23 15:07:53 427

原创 [LeetCode] Letter Combinations of a Phone Number

Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephone buttons) is given below.Input:Digit st

2014-10-23 13:57:46 383

原创 [LeetCode] Unique Paths II

Follow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle and empty space is marked as 1 and 0 respectively in the

2014-10-23 13:39:16 295

原创 [LeetCode] Unique Paths

A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).The robot can only move either down or right at any point in time. The robot is trying to reach the

2014-10-23 13:38:03 381

原创 [LeetCode] 4Sum

Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target.Note:Element

2014-10-23 12:29:19 336

原创 [LeetCode] 3Sum Closest

Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exact

2014-10-23 11:57:08 410

原创 [LeetCode] 3Sum

Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note:Elements in a triplet (a,b,c

2014-10-23 11:40:40 319

原创 [LeetCode] Insert Interval

Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals were initially sorted according to their start times.E

2014-10-23 10:45:50 327

原创 [LeetCode] Word Break II

Given a string s and a dictionary of words dict, add spaces in s to construct a sentence where each word is a valid dictionary word.Return all such possible sentences.For example, givens = "

2014-10-23 10:39:28 356

原创 [LeetCode] Reverse Linked List II

Reverse a linked list from position m to n. Do it in-place and in one-pass.For example:Given 1->2->3->4->5->NULL, m = 2 and n = 4,return 1->4->3->2->5->NULL.Note:Given m, n satisfy the

2014-10-23 10:32:41 304

原创 [LeetCode] Rotate List

Given a list, rotate the list to the right by k places, where k is non-negative.For example:Given 1->2->3->4->5->NULL and k = 2,return 4->5->1->2->3->NULL.

2014-10-23 10:31:39 319

原创 [LeetCode] Merge Intervals

Given a collection of intervals, merge all overlapping intervals.For example,Given [1,3],[2,6],[8,10],[15,18],return [1,6],[8,10],[15,18].

2014-10-23 10:28:22 333

原创 [LeetCode] Subsets II

Given a collection of integers that might contain duplicates, S, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set must not contain dupli

2014-10-23 10:21:21 310

原创 [LeetCode] Subsets

Given a set of distinct integers, S, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set must not contain duplicate subsets.For exa

2014-10-23 00:41:41 287

原创 [LeetCode] Distinct Subsequences

Given a string S and a string T, count the number of distinct subsequences of T in S.A subsequence of a string is a new string which is formed from the original string by deleting some (can be non

2014-10-23 00:25:22 323

原创 [LeetCode] Word Break II

Given a string s and a dictionary of words dict, add spaces in s to construct a sentence where each word is a valid dictionary word.Return all such possible sentences.For example, givens = "

2014-10-23 00:21:20 303

原创 [LeetCode] Gas Station

There are N gas stations along a circular route, where the amount of gas at station i is gas[i].You have a car with an unlimited gas tank and it costs cost[i] of gas to travel from station i to

2014-10-22 21:32:44 353

原创 [LeetCode] Word Break

Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words.For example, givens = "leetcode",dict = ["leet"

2014-10-22 19:48:30 353

原创 [LeetCode] Find Minimum in Rotated Sorted Array II

Follow up for "Find Minimum in Rotated Sorted Array":What if duplicates are allowed?Would this affect the run-time complexity? How and why?Suppose a sorted array is rotated at some pivot unk

2014-10-22 18:15:56 361

原创 [LeetCode] Divide Two Integers

Divide two integers without using multiplication, division and mod operator.

2014-10-16 22:23:20 352

cfree软件和补丁

简单易用的编程工具,供初级者使用。及其方便,强烈推荐。

2009-06-11

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除