Showing posts from 2017

Cut the sticks

Cut the sticks You are given  sticks, where the length of each stick is a positive integer. A cut operation is performed on the sticks such that all of them are reduced by the length of the smallest stick.---Solution---

Library Fine

Library Fine Your local library needs your help! Given the expected and actual return dates for a library book, create a program that calculates the fine (if any). The fee structure is as follows: If the book is returned on or before the expected return date, no fine will be charged (i.e.: .If the book is returned after the expected return day but still within the same calendar month and year as the expected return date,

Sherlock and Squares

Sherlock and Squares
Watson gives two integers ( and ) to Sherlock and asks if he can count the number of square integers between  and  (both inclusive). Note: A square integer is an integer which is the square of any integer. For example, 149, and 16 are some of the square integers as they are squares of 123, and