Ciel and Receipt Solution

Tomya like a positive integer p, and now she wants to get a receipt of Ciel’s restaurant whose total price is exactly p. Note that the i-th menu has the price 2i-1 (1 ≤ i ≤ 12). Find the minimum number of menus whose total price is exactly p.

String in Java

Implementing strings as a built-in objects allows Java to provide a full complement of features that makes string handling in Java very convenient. For example, Java provide various methods to modify a string object like methods to compare two strings, search for a substring, or concatenate two strings etc.