🐍Python/Python_알고리즘

    [알고리즘] 45. Repeated String

    Lilah has a string, , of lowercase English letters that she repeated infinitely many times.Given an integer, , find and print the number of letter a's in the first letters of Lilah's infinite string.For example, if the string and , the substring we consider is , the first characters of her infinite string. There are occurrences of a in the substring.Function DescriptionComplete the repeatedStrin..

    [알고리즘] 44. Cut the Sticks

    You are given a number of sticks of varying lengths. You will iteratively cut the sticks into smaller sticks, discarding the shortest pieces until there are none left. At each iteration you will determine the length of the shortest stick remaining, cut that length from each of the longer sticks and then discard all the pieces of that shortest length. When all the remaining sticks are the same le..

    [알고리즘] 43. 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 ..

    [알고리즘] 42. Sherlock and Squares

    Watson likes to challenge Sherlock's math ability. He will provide a starting and ending value describing a range of integers. Sherlock must determine the number of square integers within that range, inclusive of the endpoints.Note: A square integer is an integer which is the square of an integer, e.g. .For example, the range is and , inclusive. There are three square integers in the range: and ..

    [알고리즘] 41. Append and Delete

    You have a string of lowercase English alphabetic letters. You can perform two types of operations on the string:Append a lowercase English alphabetic letter to the end of the string.Delete the last character in the string. Performing this operation on an empty string results in an empty string.Given an integer, , and two strings, and , determine whether or not you can convert to by performing e..

    [알고리즘] 40. Extra Long Factorials

    The factorial of the integer , written , is defined as:Calculate and print the factorial of a given integer.For example, if , we calculate and get .Function DescriptionComplete the extraLongFactorials function in the editor below. It should print the result and return.extraLongFactorials has the following parameter(s):n: an integerNote: Factorials of can't be stored even in a long long variable...