Tag: string algorithm
April 4, 2014
algorithms, beginner, c / c++, code, code library, implementation, interview questions, leetcode online judge, math, programming languages, string
The sequence is interesting. It starts from ‘1’. The next number always counts the previous number in digits one by one. For example, the second number in the series …
The problem is from SPOJ Online Judge Since the input of p and q is restricted to 0 and 1, so we can just check its string value. Bit XOR …
Question: Given a string containing only numbers, restore it by returning all possible IP addresses (in a vector) Original Problem Page: http://oj.leetcode.com/problems/restore-ip-addresses/ Examples: Given "25525511135", return . (Order does not matter) A …
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. Note: For the purpose of this problem, we define empty string as valid …
Question: Determine the length of the last word in a string given in C, as const char* Problem Description: http://oj.leetcode.com/problems/length-of-last-word/ A word is defined as a sequence of non-space characters. …