摘要: 1、题目描述 Given an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if t 阅读全文
posted @ 2018-03-28 17:52 山里的小勇子 阅读(143) 评论(0) 推荐(0)
摘要: 1、题目描述 You are given a string representing an attendance record for a student. The record only contains the following three characters: A student coul 阅读全文
posted @ 2018-03-28 17:16 山里的小勇子 阅读(208) 评论(0) 推荐(0)
摘要: 1、题目描述 Given a string, sort it in decreasing order based on the frequency of characters. Example 1: Example 2: 阅读全文
posted @ 2018-03-27 20:06 山里的小勇子 阅读(872) 评论(0) 推荐(0)
摘要: 1、题目描述 Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1. Examples: s = "leetcode" re 阅读全文
posted @ 2018-03-27 18:59 山里的小勇子 阅读(1146) 评论(0) 推荐(0)
摘要: 1、题目描述 X is a good number if after rotating each digit individually by 180 degrees, we get a valid number that is different from X. Each digit must be 阅读全文
posted @ 2018-03-27 14:08 山里的小勇子 阅读(1123) 评论(0) 推荐(0)
摘要: 1、问题描述 Given a word, you need to judge whether the usage of capitals in it is right or not. We define the usage of capitals in a word to be right when 阅读全文
posted @ 2018-03-26 17:16 山里的小勇子 阅读(143) 评论(0) 推荐(0)
摘要: 1、题目描述 Given a string, you need to reverse the order of characters in each word within a sentence while still preserving whitespace and initial word o 阅读全文
posted @ 2018-03-26 16:12 山里的小勇子 阅读(163) 评论(0) 推荐(0)
摘要: 1、题目描述 Initially, there is a Robot at position (0, 0). Given a sequence of its moves, judge if this robot makes a circle, which means it moves back to 阅读全文
posted @ 2018-03-26 15:30 山里的小勇子 阅读(236) 评论(0) 推荐(0)
摘要: 1、题目描述 返回一个 string中最后一个单词的长度。单词定义为没有空格的连续的字符,比如 ‘a’,'akkk'。 2、问题分析 从后向前扫描,如果string是以空格‘ ’结尾的,就不用计数,现将空格最后的空格排除掉,直到找到最后一个出现的字符。从最后一个出现的字符开始计数,一直到下一次出现空 阅读全文
posted @ 2018-03-26 13:44 山里的小勇子 阅读(150) 评论(0) 推荐(0)
摘要: 1、题目描述 反转一个单链表。链表节点结构如下: 2、问题分析 特殊情况是输入的头结点是一个空的,或者只有一个头结点 3、代码实现 阅读全文
posted @ 2018-03-26 10:09 山里的小勇子 阅读(467) 评论(0) 推荐(0)