问题描述
给定一个年份y和一个整数d,问这一年的第d天是几月几日?
注意闰年的2月有29天。满足下面条件之一的是闰年:
1) 年份是4的整数倍,而且不是100的整数倍;
2) 年份是400的整数倍。
问题描述
给定一个年份y和一个整数d,问这一年的第d天是几月几日?
注意闰年的2月有29天。满足下面条件之一的是闰年:
1) 年份是4的整数倍,而且不是100的整数倍;
2) 年份是400的整数倍。
Given two words (beginWord and endWord), and a dictionary’s word list, find all shortest transformation sequence(s) from beginWord to endWord, such that:
Given a non-empty string s, you may delete at most one character. Judge whether you can make it a palindrome.
`
我们知道auto_ptr通过复制构造或者通过=赋值后,原来的auto_ptr对象就报废了.所有权转移到新的对象中去了.而通过shared_ptr可以让多个智能指针对象同时拥有某一块内存的访问权.但假如我们不希望多个内存块被多个智能指针对象共享,同时又不会像auto_ptr那样不知不觉的就让原来的auto_ptr对象失效,可咋整呢?
Given many words, words[i] has weight i.
Design a class WordFilter that supports one function, WordFilter.f(String prefix, String suffix). It will return the word with given prefix and suffix with maximum weight. If no word exists, return -1.
Given a chemical formula (given as a string), return the count of each atom.
An atomic element always starts with an uppercase character, then zero or more lowercase letters, representing the name.
1 or more digits representing the count of that element may follow if the count is greater than 1. If the count is 1, no digits will follow. For example, H2O and H2O2 are possible, but H1O2 is impossible.
Given a list of strings words representing an English Dictionary, find the longest word in words that can be built one character at a time by other words in words. If there is more than one possible answer, return the longest word with the smallest lexicographical order.
Given two words word1 and word2, find the minimum number of operations required to convert word1 to word2.