- 博客(38)
- 收藏
- 关注
原创 MFC中数据类型转换的一些心得
众所周知,对于C++中ASCII码以及unicode两种针对字符的编码方式有所不同,所以在我们编程的过程中,尤其是涉及强制类型转换的过程中,经常会发现最后的输出结果显示为乱码,下面介绍一个笔者在编写MFC代码中遇到的例子供大家参考–m_btn1.Create("大家好", BS_MULTILINE | BS_RADIOBUTTON | WS_VISIBLE | WS_CHILD, CRect(0,
2016-03-02 21:00:32 607
原创 leetcode 313 : Super Ugly Number
1、原题如下: Write a program to find the nth super ugly number. Super ugly numbers are positive numbers whose all prime factors are in the given prime list primes of size k. For example, [1, 2, 4, 7,
2015-12-07 12:03:11 686
原创 leetcode 312 : Burst Balloons
1、原题如下: Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represented by array nums. You are asked to burst all the balloons. If the you burst balloon i you will ge
2015-12-05 20:15:12 691
原创 leetcode 310 : Minimum Height Trees
1、原题如下: For a undirected graph with tree characteristics, we can choose any node as the root. The result graph is then a rooted tree. Among all possible rooted trees, those with minimum height are ca
2015-12-03 16:37:59 457
原创 leetcode 309 : Best Time to Buy and Sell Stock with Cooldown
1、原题如下: Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may complete as many transactions as you like
2015-12-01 17:01:45 576
原创 leetcode 307 : Range Sum Query - Mutable
1、原题如下: Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive. The update(i, val) function modifies nums by updating the element at index i to val.
2015-11-30 13:40:08 587
原创 leetcode 306 : Additive Number
1、原题如下 Additive number is a string whose digits can form additive sequence. A valid additive sequence should contain at least three numbers. Except for the first two numbers, each subsequent num
2015-11-27 21:27:38 484
原创 leetcode 304 : Range Sum Query 2D - Immutable
1、原题如下: Given a 2D matrix matrix, find the sum of the elements inside the rectangle defined by its upper left corner (row1, col1) and lower right corner (row2, col2). Range Sum Query 2D The a
2015-11-23 13:51:56 304
原创 leetcode 303 : Range Sum Query - Immutable
1、原题如下: Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive.Example: Given nums = [-2, 0, 3, -5, 2, -1]sumRange(0, 2) -> 1 sumRange(2, 5) -> -1 sumR
2015-11-20 11:22:05 326
原创 leetcode 301 : Remove Invalid Parentheses
1、原题如下: Remove the minimum number of invalid parentheses in order to make the input string valid. Return all possible results.Note: The input string may contain letters other than the parentheses ( an
2015-11-06 21:14:33 450
原创 leetcode 300 : Longest Increasing Subsequence
1、原题如下: Given an unsorted array of integers, find the length of longest increasing subsequence.For example, Given [10, 9, 2, 5, 3, 7, 101, 18], The longest increasing subsequence is [2, 3, 7, 101],
2015-11-06 13:16:18 434
原创 leetcode 240 : Search a 2D Matrix II
1、原题如下: Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:Integers in each row are sorted in ascending from left to right. Integers i
2015-11-03 11:21:22 281
原创 leetcode 299 : Bulls and Cows
1、原题如下: You are playing the following Bulls and Cows game with your friend: You write a 4-digit secret number and ask your friend to guess it. Each time your friend guesses a number, you give a hint.
2015-11-02 18:21:39 290
原创 leetcode241 : Different Ways to Add Parentheses
1、原题如下: Given a string of numbers and operators, return all possible results from computing all the different possible ways to group numbers and operators. The valid operators are +, - and *.Example 1
2015-10-30 11:42:33 285
原创 leetcode 257 : Binary Tree Paths
1、原题如下: Given a binary tree, return all root-to-leaf paths.For example, given the following binary tree:1 / \ 2 3 \ 5 All root-to-leaf paths are:[“1->2->5”, “1->3”]2、解题如下:/** * Definit
2015-10-29 14:16:51 305
原创 leetcode 260 : Single Number III
1、原题如下: Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements that appear only once.For example:Given nu
2015-10-28 15:45:19 326
原创 leetcode 264 : Ugly Number II
1、原题如下: Write a program to find the n-th ugly number.Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 1, 2, 3, 4, 5, 6, 8, 9, 10, 12 is the sequence of the firs
2015-10-28 12:40:18 320
翻译 office技巧-1 : 如何在excel中将不连续的空格替换成相同的值
1、选中你想要替换的部分 2、按下Ctrl+G,在窗口中选择定位条件 3、然后选择空值,点击确认 4、我们会发现,选中区域变成了之前选中区域的空值部分 5、键盘输入你想要输入的值,按下Ctrl+回车即可~
2015-10-27 18:54:46 2061
原创 leetcode 268 : Missing Number
1、原题如下: 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.2、解题如下:class Solution {public:
2015-10-27 15:07:22 299
原创 leetcode 273 : Integer to English Words
1、原题如下: Convert a non-negative integer to its english words representation. Given input is guaranteed to be less than 231 - 1.For example, 123 -> “One Hundred Twenty Three” 12345 -> “Twelve Thousand
2015-10-27 14:21:31 260
原创 leetcode 274 : H-Index
1、原题如下: Given an array of citations (each citation is a non-negative integer) of a researcher, write a function to compute the researcher’s h-index.According to the definition of h-index on Wikipedia:
2015-10-27 10:02:37 292
原创 leetcode 297 : Serialize and Deserialize Binary Tree
1、原题如下: Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or transmitted across a network connection li
2015-10-26 19:25:18 216
原创 leetcode 295 : Find Median from Data Stream
1、原题如下: Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two middle value. Examples: [2,3,4] , the
2015-10-24 15:32:53 272
原创 代码量统计方法
相信各位也会碰见一个大工程,突然要说统计代码量~下面介绍用正则表达式的方法统计,而非计算器~(原谅我的愚昧。。。直到数完才知道有好用的方法)步骤:1、打开整个工程,并选择查找与替换(快捷键是ctrl+shift+f)2、勾选正则表达式,并在下方选择你要搜索的文件类型3、在搜索的部分输入 ^:b*[^:b#/]+.*$ 并确定查找,即可根据匹配行得到最后的代码量结论![图A](http:
2015-10-22 19:11:55 461
原创 leetcode 279 : Perfect Squares
1、原题如下 Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, …) which sum to n. For example, given n = 12, return 3 because 12 = 4 + 4 + 4; given n =
2015-10-22 18:41:07 294
原创 leetcode282 : Expression Add Operators
1、原题如下: Given a string that contains only digits 0-9 and a target value, return all possibilities to add binary operators (not unary) +, -, or * between the digits so they evaluate to the target value
2015-10-15 14:51:55 429
原创 leetcode284 : Peeking Iterator
1、原题如下: iven an Iterator class interface with methods: next() and hasNext(), design and implement a PeekingIterator that support the peek() operation – it essentially peek() at the element that will b
2015-10-13 19:23:38 381
原创 leetcode287 : Find the Duplicate Number
1、原题如下 Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. Assume that there is only one duplicate num
2015-10-13 11:32:11 310
原创 leetcode292 : Nim Game
1、原题如下 You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 stones. The one who removes the last stone will
2015-10-13 09:56:15 481
原创 leetcode289 : Game of Life
1、原题如下: According to the Wikipedia’s article: “The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John Horton Conway in 1970.”Given a board with
2015-10-12 20:28:58 449
原创 leetcode290 : Word Pattern
1、原题如下 Given a pattern and a string str, find if str follows the same pattern.Here follow means a full match, such that there is a bijection between a letter in pattern and a non-empty word in str.Exa
2015-10-11 18:57:08 309
原创 leetcode 237 : Delete Node in a Linked List
1、原题如下: Write a function to delete a node (except the tail) in a singly linked list, given only access to that node.Supposed the linked list is 1 -> 2 -> 3 -> 4 and you are given the third node with v
2015-10-05 18:23:16 332
原创 leetcode 242 :Valid Anagram
1、原题如下 Given two strings s and t, write a function to determine if t is an anagram of s.For example, s = “anagram”, t = “nagaram”, return true. s = “rat”, t = “car”, return false.2、解题如下class Solutio
2015-10-01 21:01:16 311
原创 leetcode 258 :Add Digits
1、原题如下 Given a non-negative integer num, repeatedly add all its digits until the result has only one digit.For example:Given num = 38, the process is like: 3 + 8 = 11, 1 + 1 = 2. Since 2 has only one
2015-09-30 15:03:43 278
原创 leetcode263 : Ugly Number
1、原题如下 Write a program to check whether a given number is an ugly number.Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 6, 8 are ugly while 14 is not ugly sin
2015-09-29 22:16:38 311
原创 leetcode283 : Move Zeroes
1、原题如下 Given an array nums, write a function to move all 0’s to the end of it while maintaining the relative order of the non-zero elements.For example, given nums = [0, 1, 0, 3, 12], after calling yo
2015-09-29 21:42:27 280
原创 leetcode278:First Bad Version
1、原题如下: You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality check. Since each version is developed base
2015-09-29 16:06:05 388
转载 欢迎使用CSDN-markdown编辑器
欢迎使用Markdown编辑器写博客本Markdown编辑器使用StackEdit修改而来,用它写博客,将会带来全新的体验哦:Markdown和扩展Markdown简洁的语法代码块高亮图片链接和图片上传LaTex数学公式UML序列图和流程图离线写博客导入导出Markdown文件丰富的快捷键快捷键加粗 Ctrl + B 斜体 Ctrl + I 引用 Ctrl
2015-09-29 15:45:17 236
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人